[MPlayer-dev-eng] PATCH: Fixes seeking based on percentage for mpg's with timestamps not starting at 0

elupus elupus at ecce.se
Sat Apr 2 17:35:24 CEST 2005


Hi, 

Not sure if you guys are interested, but i'll check anyways. This patch
attempts to fix seeking based on percentage of total time in mpgs that has
timesstamps that doesn't start from 0. (I can provide a sample should that
be needed). A variant of this patch has been implemented in xbmc's variant
of mplayer to allow current playtime to be reported correctly and seeking by
percentage to work. As it is now, seeking by percentage in such a file just
makes end of file to be reached directly.

It attempts to fix this by remembering what the pts value (timestamp) found
when buffer is filled for the first time. This is based on that value of
mpg->last_pts, i suppose this really should be offset with the current
buffer size as even proper mpg's report a nonzero value here(allthough
small).  

This value can then also be used by the OSD to offset sh_video->pts to
display current playtime, but i didn't include that part in the patch as
that isn't done very cleanly in the current version used in xbmc mplayer. 

Ts/ty files suffer from the same problem at times (atleast the time
reported, haven't seen issued with seeking), so something similar should
probably be implemented in those demuxer too. 

Anyway, as mplayer normally doesn't seek by percentage and the current
playtime is't really used for anything important, this patch isn't that
important. But I thought it might be interesting nontheless.

Regards
elupus Team XBMC
-------------- next part --------------
A non-text attachment was scrubbed...
Name: demux_mpg.c.patch
Type: application/octet-stream
Size: 3027 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20050402/c764cf8b/attachment.obj>


More information about the MPlayer-dev-eng mailing list