Message ID | 1471943019-14136-14-git-send-email-erkki.seppala.ext@nokia.com |
---|---|
State | Superseded |
Headers | show |
2016-08-23 11:03 GMT+02:00 <erkki.seppala.ext@nokia.com>: > + if (id <= 0 && > + st->codecpar->codec_type == AVMEDIA_TYPE_DATA) { > + id = ff_codec_get_id(ff_codec_metadata_tags, format); > + if (id > 0) > + st->codecpar->codec_type = AVMEDIA_TYPE_DATA; Is it just me or is this a no-op? Carl Eugen
On 08/23/2016 10:18 PM, Carl Eugen Hoyos wrote: > 2016-08-23 11:03 GMT+02:00 <erkki.seppala.ext@nokia.com>: >> + if (id <= 0 && >> + st->codecpar->codec_type == AVMEDIA_TYPE_DATA) { >> + id = ff_codec_get_id(ff_codec_metadata_tags, format); >> + if (id > 0) > >> + st->codecpar->codec_type = AVMEDIA_TYPE_DATA; > > Is it just me or is this a no-op? You would be correct. Not only it is never executed, but even if it were, it would do nothing :). (I imagine I copy-paste-search-and-replaced from the one above it and the editing missed this.) Thanks for review!
diff --git a/libavformat/mov.c b/libavformat/mov.c index 9cd915d..f18c0a3 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1789,12 +1789,20 @@ static int mov_codec_id(AVStream *st, uint32_t format) id = ff_codec_get_id(ff_codec_bmp_tags, format); if (id > 0) st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; - else if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA || - (st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE && - st->codecpar->codec_id == AV_CODEC_ID_NONE)) { - id = ff_codec_get_id(ff_codec_movsubtitle_tags, format); - if (id > 0) - st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE; + else { + if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA || + (st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE && + st->codecpar->codec_id == AV_CODEC_ID_NONE)) { + id = ff_codec_get_id(ff_codec_movsubtitle_tags, format); + if (id > 0) + st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE; + } + if (id <= 0 && + st->codecpar->codec_type == AVMEDIA_TYPE_DATA) { + id = ff_codec_get_id(ff_codec_metadata_tags, format); + if (id > 0) + st->codecpar->codec_type = AVMEDIA_TYPE_DATA; + } } }