From 3f949cf50b5067f2fa18b1a2bbdfdd62a0d0ffdd Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 10 Dec 2012 23:20:42 +0100 Subject: mplayer: prefer audio PTS over video PTS for status line This slightly improves display of the current playback time in files with sparse video packets (like video tracks containing a slow MJPG slideshows as in [1]), or audio files with cover art image attachments. While the video PTS is always "stuck" at the last frame displayed or the last seek, audio is usually continuous. Given sane samplerates and working audio drivers (to query how much of the current audio buffer has been played), the audio PTS should always be more reliable. [1] http://www.podtrac.com/pts/redirect.mp3/traffic.libsyn.com/rtpodcast/Rooster_Teeth_Podcast_191.m4a --- core/mplayer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core') diff --git a/core/mplayer.c b/core/mplayer.c index 5dc35479ba..3e58279b51 100644 --- a/core/mplayer.c +++ b/core/mplayer.c @@ -2976,14 +2976,14 @@ double get_current_time(struct MPContext *mpctx) return 0; if (demuxer->stream_pts != MP_NOPTS_VALUE) return demuxer->stream_pts; + double apts = playing_audio_pts(mpctx); + if (apts != MP_NOPTS_VALUE) + return apts; if (mpctx->sh_video) { double pts = mpctx->video_pts; if (pts != MP_NOPTS_VALUE) return pts; } - double apts = playing_audio_pts(mpctx); - if (apts != MP_NOPTS_VALUE) - return apts; if (mpctx->last_seek_pts != MP_NOPTS_VALUE) return mpctx->last_seek_pts; return 0; -- cgit v1.2.3