[vorbis-dev] ov_time_seek to 0s fails... AGAIN

Matthijs Laan matthijsln at xs4all.nl
Thu Mar 1 13:52:57 PST 2001



Hello everybody, I sent something about this before, but this bug is still 
there, so...

If you call
  ov_time_seek(vf, 0);

it will fail, returning OV_EFAULT (from ov_pcm_seek_page). I think this must
be a bug, because seeking to 0 seconds *should* be OK.

Another thing, when ov_time_seek fails with OV_EFAULT, you cannot continue 
playing
(because of the goto seek_error). This is not clear from the documentation at
all, after a OV_ENOSEEK or OV_EINVAL error it seems to me that you can continue
decoding.

This had me bugged for quite some time, it caused a floating point divide 
by zero
in ov_time_tell (causing it to return -INF), because vf->vi[link].rate is 
apparently
set to zero in the seek_error part.

I think the documentation definitely needs clarification as of when the 
error is fatal
and if you can continue decoding.

A workaround for this bug is to add something like 0.01 s to the time 
seeked to if the
time is 0 s.

After the error, OggVorbis_File->decode_ready is false, which seems a 
logical result after
the error handling after the bug has occurred, but ov_time_tell does not 
check it; therefore
it can cause a divide by zero. Perhaps it is up to the programmer to check 
for it, but this
could be made a little more fool-proof with very little effort, by letting 
the functions
return an error when decode_ready is false.

I'm using Ogg Vorbis 1.0-beta4, Win32, MSVC++ 6 DLL's, Borland Delphi 5.

Matthijs

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