rawdec: use a default sample rate if none is specified.
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 18 Nov 2011 21:34:41 +0000 (22:34 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 18 Nov 2011 22:09:56 +0000 (23:09 +0100)
Fixes "ffmpeg -f s16le -i /dev/zero"

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fca85ce5ecc8acba6a5cf10c5f99e932b26c6367)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/rawdec.c

index 02e335a..d4383d5 100644 (file)
@@ -60,9 +60,9 @@ int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap)
             if (s1->sample_rate)
                 st->codec->sample_rate = s1->sample_rate;
             if (st->codec->sample_rate <= 0) {
-                av_log(s, AV_LOG_ERROR, "Invalid sample rate %d specified\n",
+                av_log(s, AV_LOG_WARNING, "Invalid sample rate %d specified using default of 44100\n",
                        st->codec->sample_rate);
-                return AVERROR(EINVAL);
+                st->codec->sample_rate= 44100;
             }
 
             if (s1->channels)