[FFmpeg-devel] [PATCH] raw_read_header fix

Michael Niedermayer michaelni
Sat Jul 14 13:29:42 CEST 2007


Hi

On Sat, Jul 14, 2007 at 11:59:18AM +0200, Alex Beregszaszi wrote:
> 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


> 
> > [...]
> > 
> > > Index: libavutil/rational.c
> > > ===================================================================
> > > --- libavutil/rational.c	(revision 9618)
> > > +++ libavutil/rational.c	(working copy)
> > > @@ -101,3 +101,7 @@
> > >  
> > >      return a;
> > >  }
> > > +
> > > +int av_valid_q(AVRational a){
> > > +    return a.num >= 0 && a.den > 0;
> > > +}
> > 
> > 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

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070714/56ab9564/attachment.pgp>



More information about the ffmpeg-devel mailing list