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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
On Thu, Mar 01, 2001 at 10:52:57PM +0100, Matthijs Laan wrote:> 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.I stress tested this before beta 4 release. Seek to random location, followed by seek to zero. After running for an hour on ten samples, there were no faults. Something else is up; you're hitting something (somewhere) in vorbis, in your code, or in a build error (linking the wrong DLLs can cause this).... but whatever it is, it likely isn't what you think it is.> 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.OV_EFAULT means "An impossible error just happened (like 2+2=5), and continuing any further is likely not possible. The code has shot itself in the head, and is unconscious and bleeding on the ground. Have a nice day."> I think the documentation definitely needs clarification as of when the > error is fatal > and if you can continue decoding.Fair enough. This error is fatal. Monty --- >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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Hello everybody,>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.The error seems to happen in latest snapshot's vorbisfile.c, function 'ov_pcm_seek_page', line 918- /* verify result */ if(vf->pcm_offset>=pos || pos>ov_pcm_total(vf,-1)){ ret=OV_EFAULT; goto seek_error; } Is "vf->pcm_offset>=pos" correct ? "vf->pcm_offset>pos" appears to work right ... -- Takahiro WATANABE <dee@bowfive.oag.co.jp> --- >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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.