]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/siff.c
Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat
[ffmpeg] / libavformat / siff.c
index 9c24c51f15696c9237881a895e0cb1132776f760..02af80bfabedb46222b35cb358149870c59ad88e 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "libavutil/intreadwrite.h"
 #include "avformat.h"
+#include "internal.h"
 
 enum SIFFTags{
     TAG_SIFF = MKTAG('S', 'I', 'F', 'F'),
@@ -75,12 +76,12 @@ static int create_audio_stream(AVFormatContext *s, SIFFContext *c)
     if (!ast)
         return -1;
     ast->codec->codec_type      = AVMEDIA_TYPE_AUDIO;
-    ast->codec->codec_id        = CODEC_ID_PCM_U8;
+    ast->codec->codec_id        = AV_CODEC_ID_PCM_U8;
     ast->codec->channels        = 1;
-    ast->codec->bits_per_coded_sample = c->bits;
+    ast->codec->bits_per_coded_sample = 8;
     ast->codec->sample_rate     = c->rate;
-    ast->codec->frame_size      = c->block_align;
-    av_set_pts_info(ast, 16, 1, c->rate);
+    avpriv_set_pts_info(ast, 16, 1, c->rate);
+    ast->start_time = 0;
     return 0;
 }
 
@@ -119,12 +120,12 @@ static int siff_parse_vbv1(AVFormatContext *s, SIFFContext *c, AVIOContext *pb)
     if (!st)
         return -1;
     st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id   = CODEC_ID_VB;
+    st->codec->codec_id   = AV_CODEC_ID_VB;
     st->codec->codec_tag  = MKTAG('V', 'B', 'V', '1');
     st->codec->width      = width;
     st->codec->height     = height;
-    st->codec->pix_fmt    = PIX_FMT_PAL8;
-    av_set_pts_info(st, 16, 1, 12);
+    st->codec->pix_fmt    = AV_PIX_FMT_PAL8;
+    avpriv_set_pts_info(st, 16, 1, 12);
 
     c->cur_frame = 0;
     c->has_video = 1;
@@ -152,7 +153,7 @@ static int siff_parse_soun(AVFormatContext *s, SIFFContext *c, AVIOContext *pb)
     return create_audio_stream(s, c);
 }
 
-static int siff_read_header(AVFormatContext *s, AVFormatParameters *ap)
+static int siff_read_header(AVFormatContext *s)
 {
     AVIOContext *pb = s->pb;
     SIFFContext *c = s->priv_data;
@@ -210,9 +211,10 @@ static int siff_read_packet(AVFormatContext *s, AVPacket *pkt)
             pkt->stream_index = 0;
             c->curstrm = -1;
         }else{
-            if (av_get_packet(s->pb, pkt, c->sndsize - 4) < 0)
+            if ((size = av_get_packet(s->pb, pkt, c->sndsize - 4)) < 0)
                 return AVERROR(EIO);
             pkt->stream_index = 1;
+            pkt->duration     = size;
             c->curstrm = 0;
         }
         if(!c->cur_frame || c->curstrm)
@@ -223,6 +225,7 @@ static int siff_read_packet(AVFormatContext *s, AVPacket *pkt)
         size = av_get_packet(s->pb, pkt, c->block_align);
         if(size <= 0)
             return AVERROR(EIO);
+        pkt->duration = size;
     }
     return pkt->size;
 }
@@ -234,5 +237,5 @@ AVInputFormat ff_siff_demuxer = {
     .read_probe     = siff_probe,
     .read_header    = siff_read_header,
     .read_packet    = siff_read_packet,
-    .extensions = "vb,son"
+    .extensions     = "vb,son",
 };