[MPlayer-dev-eng] Found a bug in some slave mode code
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Sun Sep 4 15:22:49 CEST 2011
On Sun, Sep 04, 2011 at 12:46:49AM -0500, Jeremy Lawler wrote:
> I wrote some code that utilizes slave mode, and it has come to my attention
> that "get_time_pos" has at least 1 bug.
> The "get_time_pos" command returns the value of sh_video->pts.
> Unfortunately, during DVD playback this is the position within the current
> VOB file, not the total DVD stream.
>
> I ended up using the demux->stream_pts to grab the info because the
> demuxer_get_current_time function returns ints, not floats. I assumed it
> would be preferred to keep the current precision instead of using
> get_current_time.
>
> I joined the mailing list to post this and attempted to make sure my patch
> is minimal/formatted correctly, so if there is anything wrong with the
> patch/logic, apologies.
Well... Let me start with that I'm happy to come up with a better
solution if you dislike the current one, and that also documentation
improvements are highly welcome, but the current idea is:
1) You use get_property stream_time_pos, which returns stream_pts
2) If that returns an error you can optionally fall back to get_time_pos
(or the preferred newer syntax "get_property time_pos).
More information about the MPlayer-dev-eng
mailing list