[Ffmpeg-devel] [RFC] rms calculator

Oded Shimon ods15
Mon Mar 27 19:21:59 CEST 2006


On Mon, Mar 27, 2006 at 03:04:13PM +0200, Michael Niedermayer wrote:
> Hi
> 
> On Mon, Mar 27, 2006 at 02:44:55PM +0200, Oded Shimon wrote:
> > On Mon, Mar 27, 2006 at 01:50:06PM +0200, Michael Niedermayer wrote:
> > > rejected
> > > 
> > > fseek(f[shift< 0], shift + skip, SEEK_SET);
> > > fseek(f[shift>=0],         skip, SEEK_SET);
> > > is much simpler, and whats more important it is actually correct
> > 
> > Uhh, you sure?... in that code, what if
> > shift<0 && -shift>skip
> > 
> > you would get a SEEK_SET to a negative position which is incorrect at 
> > least and possibly illegal as well... (Am I missing something?)
> > 
> > To fix his code just change to SEEK_CUR in the second fseeks...?
> 
> or put abs() around shift in mine

Personally I find all combinartions obfuscated (boolean expression as 
array index, wtf), just do the proper if's so nobody makes mistakes...

- ods15





More information about the ffmpeg-devel mailing list