]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/vocdec.c
h264: drop any pretense of support for data partitioning
[ffmpeg] / libavformat / vocdec.c
index 3c2706240865a62df1283b2e7993b1e6a1c729ba..2fb84409316981ea313b3dc375e12467be8fa9c2 100644 (file)
@@ -91,11 +91,11 @@ ff_voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size)
                 if (sample_rate)
                     dec->sample_rate = sample_rate;
                 avpriv_set_pts_info(st, 64, 1, dec->sample_rate);
+                dec->channels = channels;
+                dec->bits_per_coded_sample = av_get_bits_per_sample(dec->codec_id);
             } else
                 avio_skip(pb, 1);
-            dec->channels = channels;
             tmp_codec = avio_r8(pb);
-            dec->bits_per_coded_sample = av_get_bits_per_sample(dec->codec_id);
             voc->remaining_size -= 2;
             max_size -= 2;
             channels = 1;
@@ -117,10 +117,10 @@ ff_voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size)
             if (!dec->sample_rate) {
                 dec->sample_rate = avio_rl32(pb);
                 avpriv_set_pts_info(st, 64, 1, dec->sample_rate);
+                dec->bits_per_coded_sample = avio_r8(pb);
+                dec->channels = avio_r8(pb);
             } else
-                avio_skip(pb, 4);
-            dec->bits_per_coded_sample = avio_r8(pb);
-            dec->channels = avio_r8(pb);
+                avio_skip(pb, 6);
             tmp_codec = avio_rl16(pb);
             avio_skip(pb, 4);
             voc->remaining_size -= 12;
@@ -137,12 +137,12 @@ ff_voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size)
 
     if (tmp_codec >= 0) {
         tmp_codec = ff_codec_get_id(ff_voc_codec_tags, tmp_codec);
-        if (dec->codec_id == CODEC_ID_NONE)
+        if (dec->codec_id == AV_CODEC_ID_NONE)
             dec->codec_id = tmp_codec;
         else if (dec->codec_id != tmp_codec)
             av_log(s, AV_LOG_WARNING, "Ignoring mid-stream change in audio codec\n");
-        if (dec->codec_id == CODEC_ID_NONE) {
-            if (s->audio_codec_id == CODEC_ID_NONE) {
+        if (dec->codec_id == AV_CODEC_ID_NONE) {
+            if (s->audio_codec_id == AV_CODEC_ID_NONE) {
                 av_log(s, AV_LOG_ERROR, "unknown codec tag\n");
                 return AVERROR(EINVAL);
             }
@@ -166,10 +166,10 @@ static int voc_read_packet(AVFormatContext *s, AVPacket *pkt)
 
 AVInputFormat ff_voc_demuxer = {
     .name           = "voc",
-    .long_name      = NULL_IF_CONFIG_SMALL("Creative Voice file format"),
+    .long_name      = NULL_IF_CONFIG_SMALL("Creative Voice"),
     .priv_data_size = sizeof(VocDecContext),
     .read_probe     = voc_probe,
     .read_header    = voc_read_header,
     .read_packet    = voc_read_packet,
-    .codec_tag=(const AVCodecTag* const []){ff_voc_codec_tags, 0},
+    .codec_tag      = (const AVCodecTag* const []){ ff_voc_codec_tags, 0 },
 };