[FFmpeg-devel] [PATCH] raw_read_header fix

Måns Rullgård mans
Sat Jul 14 13:41:13 CEST 2007


Alex Beregszaszi <alex at rtfs.hu> writes:

> Hi,
>
>> > > > 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".

No, that's not a valid comparison.  It is more like converting RGB to
YUV without knowing the frame rate.  Makes perfect sense.

>> > > 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.

Yes, please say how you'd like it.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list