[MPlayer-dev-eng] [Patch] get_total_time for ogg

Michael Behrisch behrisch at informatik.hu-berlin.de
Mon Nov 10 12:56:54 CET 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Montag, 10. November 2003 12:08 schrieb Moritz Bunkus:
> Hi.
>
> > > Ah no, don't store both, only store the timecode and use
> > > (os->lastpos / os->rate) * 100 / ogg_d->final_timestamp or something
> > > like this.
> >
> > But this means, that I still have to use the rate in both places so I
> > don't see the advantage.
>
> No. os->lastpos is a granulepos and obviously belongs to the same os
> that os->rate belongs to. So calculating the 'last timestamp seen' by
> os->lastpos / os->rate is OK. But ogg_d->final_granulepos might belong to a
> totally different os! That's the problem. So if you drop
> ogg_d->final_granulepos and use ogg_d->final_timestamp then this value
> is independent of the os.

But the stream from which the granulepos is used is determined by 
the same code in ogg_scan_stream as well as in ogg_control.
So how could it possibly be a different stream? The problem is that the rate
is not always stored with the stream, at least that is what I inferred from
the rate determination in ogg_seek. Is that wrong?

Thanks for your help,
Michael

P.S: I am not against changing my code, I just want to understand the mplayer 
codebase better.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE/r30HZDyR4hR8HnQRAu8VAKDZVpK/mbRffagLDvyjA3647pFzQACeMh0l
nVFoYoiEF2B1Z340mGxp7io=
=G1Jm
-----END PGP SIGNATURE-----



More information about the MPlayer-dev-eng mailing list