diff options
author | wm4 <wm4@nowhere> | 2012-12-10 23:20:42 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-12-11 00:37:55 +0100 |
commit | 3f949cf50b5067f2fa18b1a2bbdfdd62a0d0ffdd (patch) | |
tree | e8e8193f23f498854a47c22de8bd71fc91d98635 | |
parent | 4a40eeda941717b1a3d60d22c0c1020ea9c2038d (diff) | |
download | mpv-3f949cf50b5067f2fa18b1a2bbdfdd62a0d0ffdd.tar.bz2 mpv-3f949cf50b5067f2fa18b1a2bbdfdd62a0d0ffdd.tar.xz |
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
-rw-r--r-- | core/mplayer.c | 6 |
1 files changed, 3 insertions, 3 deletions
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; |