]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/vqf.c
avidec: Ignore unknown stream types
[ffmpeg] / libavformat / vqf.c
index fb440af2fd4ce55599f2fc914dd80a10e517751b..e06f39349be8fe9352d18830b9ce55c2ebd7b9c6 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "avformat.h"
 #include "libavutil/intreadwrite.h"
+#include "libavutil/dict.h"
 
 typedef struct VqfContext {
     int frame_bit_len;
@@ -56,7 +57,7 @@ static void add_metadata(AVFormatContext *s, const char *tag,
         return;
     avio_read(s->pb, buf, len);
     buf[len] = 0;
-    av_metadata_set2(&s->metadata, tag, buf, AV_METADATA_DONT_STRDUP_VAL);
+    av_dict_set(&s->metadata, tag, buf, AV_DICT_DONT_STRDUP_VAL);
 }
 
 static int vqf_read_header(AVFormatContext *s, AVFormatParameters *ap)
@@ -72,7 +73,7 @@ static int vqf_read_header(AVFormatContext *s, AVFormatParameters *ap)
     if (!st)
         return AVERROR(ENOMEM);
 
-    avio_seek(s->pb, 12, SEEK_CUR);
+    avio_skip(s->pb, 12);
 
     header_size = avio_rb32(s->pb);
 
@@ -101,7 +102,7 @@ static int vqf_read_header(AVFormatContext *s, AVFormatParameters *ap)
             st->codec->channels = avio_rb32(s->pb) + 1;
             read_bitrate        = avio_rb32(s->pb);
             rate_flag           = avio_rb32(s->pb);
-            avio_seek(s->pb, len-12, SEEK_CUR);
+            avio_skip(s->pb, len-12);
 
             st->codec->bit_rate              = read_bitrate*1000;
             st->codec->bits_per_coded_sample = 16;
@@ -140,7 +141,7 @@ static int vqf_read_header(AVFormatContext *s, AVFormatParameters *ap)
             av_log(s, AV_LOG_ERROR, "Unknown chunk: %c%c%c%c\n",
                    ((char*)&chunk_tag)[0], ((char*)&chunk_tag)[1],
                    ((char*)&chunk_tag)[2], ((char*)&chunk_tag)[3]);
-            avio_seek(s->pb, FFMIN(len, header_size), SEEK_CUR);
+            avio_skip(s->pb, FFMIN(len, header_size));
             break;
         }
 
@@ -200,7 +201,7 @@ static int vqf_read_packet(AVFormatContext *s, AVPacket *pkt)
     int ret;
     int size = (c->frame_bit_len - c->remaining_bits + 7)>>3;
 
-    pkt->pos          = url_ftell(s->pb);
+    pkt->pos          = avio_tell(s->pb);
     pkt->stream_index = 0;
 
     if (av_new_packet(pkt, size+2) < 0)