diff options
author | wm4 <wm4@nowhere> | 2015-01-29 12:10:07 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-01-29 15:15:01 +0100 |
commit | 86d4094b98dcfb3e57578c38d842fa7a13aa2605 (patch) | |
tree | 58efe55ea2500d4d22747ef7ca28e51a5fb8471f /player/video.c | |
parent | 34d3a27f28030a05830a775420cc692a2156bf7d (diff) | |
download | mpv-86d4094b98dcfb3e57578c38d842fa7a13aa2605.tar.bz2 mpv-86d4094b98dcfb3e57578c38d842fa7a13aa2605.tar.xz |
player: remove redundant variable
mpctx->audio_delay always has the same value as opts->audio_delay. (This
was not the case a long time ago, when the audio-delay property didn't
actually write to opts->audio_delay. I think.)
Diffstat (limited to 'player/video.c')
-rw-r--r-- | player/video.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/player/video.c b/player/video.c index e0424eab4e..442ae0d19f 100644 --- a/player/video.c +++ b/player/video.c @@ -528,7 +528,7 @@ static void adjust_sync(struct MPContext *mpctx, double v_pts, double frame_time if (mpctx->audio_status != STATUS_PLAYING) return; - double a_pts = written_audio_pts(mpctx) + mpctx->audio_delay - mpctx->delay; + double a_pts = written_audio_pts(mpctx) + opts->audio_delay - mpctx->delay; double av_delay = a_pts - v_pts; double change = av_delay * 0.1; @@ -704,6 +704,8 @@ static void update_avsync_before_frame(struct MPContext *mpctx) // Update the A/V sync difference after a video frame has been shown. static void update_avsync_after_frame(struct MPContext *mpctx) { + struct MPOpts *opts = mpctx->opts; + mpctx->time_frame -= get_relative_time(mpctx); mpctx->last_av_difference = 0; @@ -713,10 +715,9 @@ static void update_avsync_after_frame(struct MPContext *mpctx) double a_pos = playing_audio_pts(mpctx); - mpctx->last_av_difference = a_pos - mpctx->video_pts + mpctx->audio_delay; + mpctx->last_av_difference = a_pos - mpctx->video_pts + opts->audio_delay; if (mpctx->time_frame > 0) - mpctx->last_av_difference += - mpctx->time_frame * mpctx->opts->playback_speed; + mpctx->last_av_difference += mpctx->time_frame * opts->playback_speed; if (a_pos == MP_NOPTS_VALUE || mpctx->video_pts == MP_NOPTS_VALUE) mpctx->last_av_difference = MP_NOPTS_VALUE; if (mpctx->last_av_difference > 0.5 && !mpctx->drop_message_shown) { |