On Wed, Dec 28, 2011 at 10:56:34AM +0100, Anton Khirnov wrote:
> 
> 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.

Damn, you spoil the fun.
Actually wrong samplerate will just shift the pitch but I agree that there's
no reason to assume some default bitrate and thus it's better to reject this
patch.

Or maybe we just need to change all error messages into warnings and fill
missing parameters with random values. It will be really user-friendly then.
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to