[FFmpeg-devel] [PATCH] avformat/utils: fix logic failure

Paul B Mahol onemda at gmail.com
Tue Oct 29 11:45:20 EET 2019


Fixes decoding of wav file which is wrongly recognized as mp1 audio.

Signed-off-by: Paul B Mahol <onemda at gmail.com>
---
 libavformat/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index cfb6d03397..bf27531ed0 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -370,7 +370,7 @@ static int set_codec_from_probe_data(AVFormatContext *s, AVStream *st,
                 if (fmt_id_type[i].type != AVMEDIA_TYPE_AUDIO &&
                     st->codecpar->sample_rate)
                     continue;
-                if (st->request_probe > score &&
+                if (st->request_probe > score ||
                     st->codecpar->codec_id != fmt_id_type[i].id)
                     continue;
                 st->codecpar->codec_id   = fmt_id_type[i].id;
-- 
2.17.1



More information about the ffmpeg-devel mailing list