Browse code

rawdec: use a default sample rate if none is specified. Fixes "ffmpeg -f s16le -i /dev/zero"

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2011/11/19 06:34:41
Showing 1 changed files
... ...
@@ -57,9 +57,9 @@ int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap)
57 57
             if (s1 && s1->sample_rate)
58 58
                 st->codec->sample_rate = s1->sample_rate;
59 59
             if (st->codec->sample_rate <= 0) {
60
-                av_log(s, AV_LOG_ERROR, "Invalid sample rate %d specified\n",
60
+                av_log(s, AV_LOG_WARNING, "Invalid sample rate %d specified using default of 44100\n",
61 61
                        st->codec->sample_rate);
62
-                return AVERROR(EINVAL);
62
+                st->codec->sample_rate= 44100;
63 63
             }
64 64
 
65 65
             if (s1 && s1->channels)