From 72bdc5d3af22735753e1487fd251db09f8a20194 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 26 Feb 2013 00:38:36 +0100 Subject: core: use playback time to determine playback percent position The percent position is used for the OSD, the status line, and for the OSD bar (shown on seeks). By default, the PTS of the last demuxed packet was used to calculate it. This led to a "jumpy" display when the percentage value (casted to int) was changing. The reasons for this were the presence of video frame reordering (packet PTS is not monotonic), or getting PTS values from different streams (like audio/subs). Since these rely on PTS values and correct file durations anyway, simplify it by calculating it with the current playback position in mplayer.c instead. --- demux/demux_mkv.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'demux/demux_mkv.c') diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c index 9604a8bafe..a769aac127 100644 --- a/demux/demux_mkv.c +++ b/demux/demux_mkv.c @@ -2505,14 +2505,6 @@ static int demux_mkv_control(demuxer_t *demuxer, int cmd, void *arg) *((double *) arg) = (double) mkv_d->duration; return DEMUXER_CTRL_OK; - case DEMUXER_CTRL_GET_PERCENT_POS: - if (mkv_d->duration == 0) { - return DEMUXER_CTRL_DONTKNOW; - } - - *((int *) arg) = (int) (100 * mkv_d->last_pts / mkv_d->duration); - return DEMUXER_CTRL_OK; - case DEMUXER_CTRL_SWITCH_AUDIO:; int new_aid = *(int *) arg; int current_aid = demuxer->audio->id; -- cgit v1.2.3