[FFmpeg-devel] [PATCH v2] avformat/utils: Fixes misdetection of zYLx.wav

lance.lmwang at gmail.com lance.lmwang at gmail.com
Thu Nov 7 03:23:17 EET 2019


From: Limin Wang <lance.lmwang at gmail.com>

Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
---
 libavformat/wavdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
index 52194f54ef..109c931a22 100644
--- a/libavformat/wavdec.c
+++ b/libavformat/wavdec.c
@@ -149,7 +149,8 @@ static int wav_probe(const AVProbeData *p)
 
 static void handle_stream_probing(AVStream *st)
 {
-    if (st->codecpar->codec_id == AV_CODEC_ID_PCM_S16LE) {
+    if (st->codecpar->codec_id == AV_CODEC_ID_PCM_S16LE &&
+        st->codecpar->sample_rate <= 0 && st->codecpar->channels <= 0) {
         st->request_probe = AVPROBE_SCORE_EXTENSION;
         st->probe_packets = FFMIN(st->probe_packets, 32);
     }
-- 
2.21.0



More information about the ffmpeg-devel mailing list