[vorbis-dev] getting playback length from ogg vorbis file

Lourens Veen lourens at rainbowdesert.net
Sat Jul 12 01:25:30 PDT 2003



On Sat 12 July 2003 01:33, Jack Angel wrote:
> On Fri, 11 Jul 2003 12:39:29 +0200
>
> Lourens Veen <lourens at rainbowdesert.net> wrote:
> > Hold on, that seems to give incorrect results. There is
> > something fishy there with the floor() construction. This seems
> > to work better:
<snip>
> >
> > Also, I understand why this works :-). But I still don't see
> > why (long)((time - floor(time) * 100.0) doesn't work...
>
> This doesn't work because <math.h> isn't included, and floor
> definition is picked up from somewhere else. I don't know from
> where, but check this:

Aha! That makes sense. Should have used -Wall as Ken says in his 
mail...

<snip>

> It started working fine after including <math.h>
> We may include <math.h> and your initial code would be ok, or we
> could end up with code you wrote now. Also, after thinking a
> little, i though 1/100 isn't the round number - better use
> milliseconds. So, i propose this patch to be integrated to
> vorbistools:

Agreed, milliseconds would be better. The new patch in the other 
mail seems fine to me (except that unified (-u) diffs are more 
readable).

Lourens

-- 
GPG public key: http://home.student.utwente.nl/l.e.veen/lourens.key

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.




More information about the Vorbis-dev mailing list