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>
(cherry picked from commit fca85ce5ecc8acba6a5cf10c5f99e932b26c6367)

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

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