summaryrefslogtreecommitdiff
path: root/libavformat/tta.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-06-16 18:46:35 +0000
committerPaul B Mahol <onemda@gmail.com>2013-06-16 18:56:56 +0000
commit9ea7ff7955192c38ac277a19920a96deed510be1 (patch)
treeb8461e4afdddb7fb9c87b60e59094d55d359e523 /libavformat/tta.c
parent78d2d1e0270cfbd38022f63f477381ed4294d22c (diff)
tta: read ape tags last
Otherwise, cover art will create video stream with index 0. Fixes #2677. Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat/tta.c')
-rw-r--r--libavformat/tta.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libavformat/tta.c b/libavformat/tta.c
index dec86c0a6c..bbb6a2292c 100644
--- a/libavformat/tta.c
+++ b/libavformat/tta.c
@@ -60,11 +60,6 @@ static int tta_read_header(AVFormatContext *s)
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, pos, SEEK_SET);
- }
start_offset = avio_tell(s->pb);
ffio_init_checksum(s->pb, tta_check_crc, UINT32_MAX);
@@ -143,6 +138,12 @@ static int tta_read_header(AVFormatContext *s)
st->codec->sample_rate = samplerate;
st->codec->bits_per_coded_sample = bps;
+ if (s->pb->seekable) {
+ int64_t pos = avio_tell(s->pb);
+ ff_ape_parse_tag(s);
+ avio_seek(s->pb, pos, SEEK_SET);
+ }
+
return 0;
}