[vorbis-dev] ogg123 timekeeping
Kenneth Arnold
kcarnold at yahoo.com
Tue Aug 1 19:38:49 PDT 2000
Does this look okay? :
Time: 1:15.50 of 4:13.73, Bitrate: 133.3
How about? :
<snip from=ogg123.c>
info.u_time = ov_time_total (&vf, -1); /* Seconds with double precision */
gettimeofday (&start_time, NULL);
t_min = (long) info.u_time / (long) 60;
t_sec = info.u_time - 60 * t_min;
while (! eos)
{
gettimeofday (&cur_time, NULL);
c_min = (long) (cur_time.tv_sec - start_time.tv_sec) / (long) 60;
c_sec = (cur_time.tv_sec - start_time.tv_sec) - 60 * c_min +
((cur_time.tv_usec - start_time.tv_usec) / 1000000.0);
</snip>
Scream now! I'm committing...
I know time functions like this have easy equivalents on other OSes.
Kenneth
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
More information about the Vorbis-dev
mailing list