Anton Khirnov <[email protected]> writes:

> On Wed, 28 Dec 2011 09:23:31 +0100, Kostya Shishkov 
> <[email protected]> wrote:
>> On Wed, Dec 28, 2011 at 12:50:35AM -0500, Derek Buitenhuis wrote:
>> > From: Michael Niedermayer <[email protected]>
>> > 
>> > Signed-off-by: Michael Niedermayer <[email protected]>
>> > ---
>> >  libavformat/rawdec.c |    4 ++--
>> >  1 files changed, 2 insertions(+), 2 deletions(-)
>> > 
>> > diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c
>> > index 6be48c5..9d9e00f 100644
>> > --- a/libavformat/rawdec.c
>> > +++ b/libavformat/rawdec.c
>> > @@ -58,9 +58,9 @@ int ff_raw_read_header(AVFormatContext *s, 
>> > AVFormatParameters *ap)
>> >              if (s1 && 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 && s1->channels)
>> > -- 
>> 
>> needs more spaces and bikeshedding about default sample rate (why not 8000
>> for instance)
>
> I'm against this patch. There is absolutely no reason to assume any
> specific samplerate here and a wrong samplerate will produce garbage.
> The user should always set a samplerate.

+100

If the user failed to specify anything, no value is more likely than any
other, and a wrong guess will be more annoying than a clear error message.

-- 
Måns Rullgård
[email protected]
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to