]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/iv8.c
mp3dec: read the initial/trailing padding from the LAME tag
[ffmpeg] / libavformat / iv8.c
index d036636f6bd531fa1c05bf71b3c7550e84ca517e..1fa88c4eeb0a1a7f94579470a6c8dd030df4a87c 100644 (file)
  */
 
 #include "avformat.h"
+#include "internal.h"
 
 
 static int probe(AVProbeData *p)
 {
-    // the single file i have starts with that, i dont know if others do too
+    // the single file I have starts with that, I do not know if others do, too
     if(   p->buf[0] == 1
        && p->buf[1] == 1
        && p->buf[2] == 3
@@ -36,7 +37,7 @@ static int probe(AVProbeData *p)
     return 0;
 }
 
-static int read_header(AVFormatContext *s, AVFormatParameters *ap)
+static int read_header(AVFormatContext *s)
 {
     AVStream *st;
 
@@ -44,10 +45,10 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
     if (!st)
         return AVERROR(ENOMEM);
 
-    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id = CODEC_ID_MPEG4;
+    st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
+    st->codecpar->codec_id = AV_CODEC_ID_MPEG4;
     st->need_parsing = AVSTREAM_PARSE_FULL;
-    av_set_pts_info(st, 64, 1, 90000);
+    avpriv_set_pts_info(st, 64, 1, 90000);
 
     return 0;
 
@@ -91,7 +92,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
             ret = av_append_packet(s->pb, pkt, size);
             if (ret < 0) {
                 av_log(s, AV_LOG_ERROR, "failed to grow packet\n");
-                av_free_packet(pkt);
+                av_packet_unref(pkt);
                 return ret;
             }
         }
@@ -109,10 +110,9 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
 
 AVInputFormat ff_iv8_demuxer = {
     .name           = "iv8",
-    .long_name      = NULL_IF_CONFIG_SMALL("A format generated by IndigoVision 8000 video server"),
+    .long_name      = NULL_IF_CONFIG_SMALL("IndigoVision 8000 video"),
     .read_probe     = probe,
     .read_header    = read_header,
     .read_packet    = read_packet,
-    .flags= AVFMT_GENERIC_INDEX,
-    .value = CODEC_ID_MPEG4,
+    .flags          = AVFMT_GENERIC_INDEX,
 };