You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avidec: do not export stream_codec_tag
Handle its only existing use case internally.
This commit is contained in:
@@ -2047,8 +2047,7 @@ static int decode_user_data(Mpeg4DecContext *ctx, GetBitContext *gb)
|
|||||||
ctx->xvid_build = build;
|
ctx->xvid_build = build;
|
||||||
|
|
||||||
if (ctx->xvid_build == -1 && ctx->divx_version == -1 && ctx->lavc_build == -1) {
|
if (ctx->xvid_build == -1 && ctx->divx_version == -1 && ctx->lavc_build == -1) {
|
||||||
if (s->stream_codec_tag == AV_RL32("XVID") ||
|
if (s->codec_tag == AV_RL32("XVID") ||
|
||||||
s->codec_tag == AV_RL32("XVID") ||
|
|
||||||
s->codec_tag == AV_RL32("XVIX") ||
|
s->codec_tag == AV_RL32("XVIX") ||
|
||||||
s->codec_tag == AV_RL32("RMP4") ||
|
s->codec_tag == AV_RL32("RMP4") ||
|
||||||
s->codec_tag == AV_RL32("ZMP4") ||
|
s->codec_tag == AV_RL32("ZMP4") ||
|
||||||
|
@@ -42,6 +42,7 @@ typedef struct AVIStream {
|
|||||||
int remaining;
|
int remaining;
|
||||||
int packet_size;
|
int packet_size;
|
||||||
|
|
||||||
|
uint32_t handler;
|
||||||
uint32_t scale;
|
uint32_t scale;
|
||||||
uint32_t rate;
|
uint32_t rate;
|
||||||
int sample_size; /* size of one sample (or packet)
|
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);
|
assert(stream_index < s->nb_streams);
|
||||||
st->codec->stream_codec_tag = handler;
|
ast->handler = handler;
|
||||||
|
|
||||||
avio_rl32(pb); /* flags */
|
avio_rl32(pb); /* flags */
|
||||||
avio_rl16(pb); /* priority */
|
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
|
/* This is needed to get the pict type which is necessary
|
||||||
* for generating correct pts. */
|
* for generating correct pts. */
|
||||||
st->need_parsing = AVSTREAM_PARSE_HEADERS;
|
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
|
// Support "Resolution 1:1" for Avid AVI Codec
|
||||||
if (tag1 == MKTAG('A', 'V', 'R', 'n') &&
|
if (tag1 == MKTAG('A', 'V', 'R', 'n') &&
|
||||||
st->codec->extradata_size >= 31 &&
|
st->codec->extradata_size >= 31 &&
|
||||||
@@ -701,7 +707,7 @@ static int avi_read_header(AVFormatContext *s)
|
|||||||
st->need_parsing = AVSTREAM_PARSE_NONE;
|
st->need_parsing = AVSTREAM_PARSE_NONE;
|
||||||
/* AVI files with Xan DPCM audio (wrongly) declare PCM
|
/* AVI files with Xan DPCM audio (wrongly) declare PCM
|
||||||
* audio in the header but have Axan as stream_code_tag. */
|
* 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_id = AV_CODEC_ID_XAN_DPCM;
|
||||||
st->codec->codec_tag = 0;
|
st->codec->codec_tag = 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user