[FFmpeg-devel] [PATCH] raw_read_header fix

Alex Beregszaszi alex
Sat Jul 14 13:37:02 CEST 2007


> > > > pcm.diff adds checks into pcm.c to bail out when no sampling rate or
> > > > channels are set, as itself cannot fill those fields out.
> > > 
> > > but decoding of pcm as well as alaw/ulaw should work fine without a sample
> > > rate, so its wrong to fail ...
> > 
> > Why is it wrong? What can you do with it without knowing the settings?
> well you can convert alaw<->pcm for example witout knowing the samplerate

You can, but still the output wont contain any headers. Are we supposed
to do blind conversions? This is the same as if you would pass RGB data
as YUV to the MPEG2 encoder and say it is the way it should. Surely it
can be done, and you will get some output afterwards decoding, but still
not the thing we call "valid".

> > > nonsense, theres nothing invalid on an AVRational if these are false
> > 
> > Okay than av_rescale_q/rnd must be fixed to avoid crash with den=0.
> no, i disagree, av_rescale rescales an integer, that cant work with den=0
> still this doesnt make x/0 invalid, its not a real number and calculations
> with it wont follow all the rules of a field but still handling it
> sanely (like most FPUs) makes sense IMHO

Sure, but can you concentrate on the initial question? Can you fix this
issue in a way you prefer? Running seektest on ulaw/alaw (which is
enabled by default) causes division by zero.


More information about the ffmpeg-devel mailing list