tta: unbreak demuxing of files with id3 tags at start of file
authorPaul B Mahol <onemda@gmail.com>
Fri, 7 Jun 2013 10:28:13 +0000 (10:28 +0000)
committerPaul B Mahol <onemda@gmail.com>
Fri, 7 Jun 2013 10:39:21 +0000 (10:39 +0000)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavformat/tta.c

index ec006a8e70ac9c596fdab0a335eb6f22044f72c9..dec86c0a6ce8de97a3e86bb7c6da75260ff45ff8 100644 (file)
@@ -59,12 +59,12 @@ static int tta_read_header(AVFormatContext *s)
     uint64_t framepos, start_offset;
     uint32_t nb_samples, crc;
 
+    ff_id3v1_read(s);
     if (s->pb->seekable) {
+        int64_t pos = avio_tell(s->pb);
         ff_ape_parse_tag(s);
-        avio_seek(s->pb, 0, SEEK_SET);
+        avio_seek(s->pb, pos, SEEK_SET);
     }
-    if (!av_dict_get(s->metadata, "", NULL, AV_DICT_IGNORE_SUFFIX))
-        ff_id3v1_read(s);
 
     start_offset = avio_tell(s->pb);
     ffio_init_checksum(s->pb, tta_check_crc, UINT32_MAX);