Akshay Dhalwala
2001-Jul-15 23:50 UTC
[vorbis-dev] getting a wierd results from ov_time_tell()
>From the documentation that I read, ov_time_tell is supposed to tell youthe how many seconds the decoder is into in the stream. However, I'm getting some weird results from it. On my stream (which is seekable - I verified it), ov_time_total returns the correct total seconds. However, when I start playing, ov_time_tell first gives me a wrong floating point number (like 4.969.). when I call it a second later, I get something like 9. as I decode the stream, the time that ov_time_tell is not the right time - one second into the song, and it returns a number much higher than 1. Has anyone else experienced this?? (a debug log file that my program creates) ///////////////////////////// Directsound object created cooperative level set test.ogg opened channels: 2 sampling rate: 44100 DS buffer size: 819200 Sound buffer created number of bitstreams: 1 total time: 355 Seekable: 1 filling buffer 200 Current Time: 4.64399 Current Time: 4.64399 Current Time: 4.64399 Current Time: 4.64399 resetting write cursor filling buffer 200 Current Time: 5.04018 Current Time: 9.28798 Current Time: 9.28798 Current Time: 9.28798 Current Time: 9.28798 resetting write cursor filling buffer 200 Current Time: 13.932 Current Time: 13.932 Current Time: 13.932 Current Time: 13.932 Current Time: 13.932 resetting write cursor filling buffer 200 Current Time: 18.576 Current Time: 18.576 Current Time: 18.576 Current Time: 18.576 resetting write cursor filling buffer 200 Current Time: 21.641 Current Time: 23.22 Current Time: 23.22 Current Time: 23.22 Current Time: 23.22 resetting write cursor filling buffer 200 Current Time: 27.8639 Current Time: 27.8639 exiting playback thread exiting.... /////////////////////// the places where it says current time are the interesting ones. Where it says 27.8639, that is actually about 5-10 seconds into the song. current time is written to the debug log every one second. akshay --- >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 Sun, Jul 15, 2001 at 11:50:46PM -0700, Akshay Dhalwala wrote:> >From the documentation that I read, ov_time_tell is supposed to tell you > the how many seconds the decoder is into in the stream.Yes, it gives the time offset in seconds of the next sample to be read from the internal buffer by ov_read();> However, I'm > getting some weird results from it. On my stream (which is seekable - I > verified it), ov_time_total returns the correct total seconds. However, > when I start playing, ov_time_tell first gives me a wrong floating point > number (like 4.969.). when I call it a second later, I get something > like 9. as I decode the stream, the time that ov_time_tell is not the > right time - one second into the song, and it returns a number much > higher than 1. Has anyone else experienced this??I have a test script here that holds the entire sample, decoded, in memory and does 10,000 time seeks, time reads and then a decode to see that the decoded data matches what's in the big memory buffer exactly at the proper sample position. Are you perhaps prefetching data from ov_read to fill a buffer of your own (eg, the DirectShow buffer)?:> Seekable: > 1 > filling buffer > 200 > Current Time: > 4.64399If you've already read 4.6 seconds of data from ov_read and put it in the DS buffer, naturally ov_time_tell will not return 0 just because the DS buffer hasn't begun playing yet. 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.