diff options
author | Anton Khirnov <anton@khirnov.net> | 2014-11-14 15:11:09 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2015-01-27 09:13:45 +0100 |
commit | f771b3ab5d3c0b763ee356152be550f4121babd0 (patch) | |
tree | 940da7edf98d4707cc8470d3c03d7262853c9da7 /libavformat/avidec.c | |
parent | 167e004e1aca7765686ed95d7cd8ea5064d4f6f6 (diff) | |
download | ffmpeg-f771b3ab5d3c0b763ee356152be550f4121babd0.tar.gz |
avidec: do not export stream_codec_tag
Handle its only existing use case internally.
Diffstat (limited to 'libavformat/avidec.c')
-rw-r--r-- | libavformat/avidec.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c index e7202de8d4..439d39d1b7 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -42,6 +42,7 @@ typedef struct AVIStream { int remaining; int packet_size; + uint32_t handler; uint32_t scale; uint32_t rate; int sample_size; /* size of one sample (or packet) @@ -515,7 +516,7 @@ static int avi_read_header(AVFormatContext *s) } assert(stream_index < s->nb_streams); - st->codec->stream_codec_tag = handler; + ast->handler = handler; avio_rl32(pb); /* flags */ avio_rl16(pb); /* priority */ @@ -650,6 +651,11 @@ static int avi_read_header(AVFormatContext *s) /* This is needed to get the pict type which is necessary * for generating correct pts. */ st->need_parsing = AVSTREAM_PARSE_HEADERS; + + if (st->codec->codec_id == AV_CODEC_ID_MPEG4 && + ast->handler == MKTAG('X', 'V', 'I', 'D')) + st->codec->codec_tag = MKTAG('X', 'V', 'I', 'D'); + // Support "Resolution 1:1" for Avid AVI Codec if (tag1 == MKTAG('A', 'V', 'R', 'n') && st->codec->extradata_size >= 31 && @@ -701,7 +707,7 @@ static int avi_read_header(AVFormatContext *s) st->need_parsing = AVSTREAM_PARSE_NONE; /* AVI files with Xan DPCM audio (wrongly) declare PCM * audio in the header but have Axan as stream_code_tag. */ - if (st->codec->stream_codec_tag == AV_RL32("Axan")) { + if (ast->handler == AV_RL32("Axan")) { st->codec->codec_id = AV_CODEC_ID_XAN_DPCM; st->codec->codec_tag = 0; } |