mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-06-04 05:57:49 +02:00
avformat/utils: Do not detect video codecs when audio is expected
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
3646ef6f7c
commit
824906a541
@ -315,6 +315,9 @@ static int set_codec_from_probe_data(AVFormatContext *s, AVStream *st,
|
|||||||
fmt->name, score);
|
fmt->name, score);
|
||||||
for (i = 0; fmt_id_type[i].name; i++) {
|
for (i = 0; fmt_id_type[i].name; i++) {
|
||||||
if (!strcmp(fmt->name, fmt_id_type[i].name)) {
|
if (!strcmp(fmt->name, fmt_id_type[i].name)) {
|
||||||
|
if (fmt_id_type[i].type != AVMEDIA_TYPE_AUDIO &&
|
||||||
|
st->codecpar->sample_rate)
|
||||||
|
continue;
|
||||||
st->codecpar->codec_id = fmt_id_type[i].id;
|
st->codecpar->codec_id = fmt_id_type[i].id;
|
||||||
st->codecpar->codec_type = fmt_id_type[i].type;
|
st->codecpar->codec_type = fmt_id_type[i].type;
|
||||||
st->internal->need_context_update = 1;
|
st->internal->need_context_update = 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user