summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-02-01 18:32:26 +0100
committerwm4 <wm4@nowhere>2015-02-01 18:32:26 +0100
commit5af4c81e5be9d245c3780f3cca5515d09b0f5fbf (patch)
tree5857604e19fcb1c4393e3aa119c9cb28e810edb4 /player
parent12dbbcbb15ca607f0c8c713ed2b24378b24c713c (diff)
downloadmpv-5af4c81e5be9d245c3780f3cca5515d09b0f5fbf.tar.bz2
mpv-5af4c81e5be9d245c3780f3cca5515d09b0f5fbf.tar.xz
player: dump audio jitter to stats file
This allows us to plot the difference between video timestamps, and the adjusted video timestamps due to syncing video to audio speed.
Diffstat (limited to 'player')
-rw-r--r--player/video.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/player/video.c b/player/video.c
index 0485ba70ec..17530ab279 100644
--- a/player/video.c
+++ b/player/video.c
@@ -662,7 +662,11 @@ static void update_avsync_before_frame(struct MPContext *mpctx)
!ao_untimed(mpctx->ao))
{
double buffered_audio = ao_get_delay(mpctx->ao);
- MP_TRACE(mpctx, "audio delay=%f\n", buffered_audio);
+
+ double predicted = mpctx->delay / opts->playback_speed +
+ mpctx->time_frame;
+ double difference = buffered_audio - predicted;
+ MP_STATS(mpctx, "value %f audio-diff", difference);
if (opts->autosync) {
/* Smooth reported playback position from AO by averaging
@@ -672,9 +676,6 @@ static void update_avsync_before_frame(struct MPContext *mpctx)
* This is badly implemented; the behavior of the smoothing
* now undesirably depends on how often this code runs
* (mainly depends on video frame rate). */
- double predicted = mpctx->delay / opts->playback_speed +
- mpctx->time_frame;
- double difference = buffered_audio - predicted;
buffered_audio = predicted + difference / opts->autosync;
}