summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-02-05 18:32:26 +0100
committerwm4 <wm4@nowhere>2013-02-05 18:32:26 +0100
commit630a2b195acb3768b67ad81539fc0117a12c1293 (patch)
tree647692282d1d96e41eaf3ff6ac2f8dd38b07672f /core
parentcd08785aab520dcdeb444998c404bd9e31ad6d07 (diff)
downloadmpv-630a2b195acb3768b67ad81539fc0117a12c1293.tar.bz2
mpv-630a2b195acb3768b67ad81539fc0117a12c1293.tar.xz
mplayer: don't show bogus audio PTS during hr-seek
This fixes a problem that happened with syncplay.pl [1] when ad_mpg123 was in use, and get_current_time() returning a bogus time position. This only happens during seeking; the reported time is correct after the seek is done. The audio PTS as returned by playing_audio_pts() is simply bogus during hr-seek. With ad_ffmpeg, it was actually set to MP_NOPTS_VALUE during seeking, so get_current_time() did a fallback to the video PTS. However, ad_mpg123 is different and explicitly decodes some audio when resetting on seek (reasons why it does this unknown and uninvestigated; apparently it's to reinit libmpg123). As a result, the audio PTS was set to the start position of the seek (or something similar), which could be very different from the seek target time. This confused syncplay. It got the bogus time because it spams the player with read commands to the "time-pos" property, so this corner case was hit. Fix this by making get_current_time() return the seek target time if hr-seek is active. This should make behavior the same as before commit 3f949cf "mplayer: prefer audio PTS over video PTS for status line". [1] http://syncplay.pl
Diffstat (limited to 'core')
-rw-r--r--core/mplayer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/mplayer.c b/core/mplayer.c
index 44bfc81e3b..819c182a2e 100644
--- a/core/mplayer.c
+++ b/core/mplayer.c
@@ -3000,6 +3000,8 @@ double get_current_time(struct MPContext *mpctx)
return 0;
if (demuxer->stream_pts != MP_NOPTS_VALUE)
return demuxer->stream_pts;
+ if (mpctx->hrseek_active)
+ return mpctx->hrseek_pts;
double apts = playing_audio_pts(mpctx);
if (apts != MP_NOPTS_VALUE)
return apts;