summaryrefslogtreecommitdiffstats
path: root/player/core.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-08-10 18:40:16 +0200
committerwm4 <wm4@nowhere>2015-08-10 18:40:16 +0200
commitfedaad8250b9c9e262da3cda2114ccf5b62703a3 (patch)
treeffd35bcfbb0b50f828ecb7e78756478248311395 /player/core.h
parent3d1cc17ab27b98294f5710e69250e95347d84598 (diff)
downloadmpv-fedaad8250b9c9e262da3cda2114ccf5b62703a3.tar.bz2
mpv-fedaad8250b9c9e262da3cda2114ccf5b62703a3.tar.xz
player: separate controls for user and video controlled speed
For video sync, we want separate playback speed controls for user- requested speed and the "correction" speed for video timing. Further, we use this separation to make sure only a resampler is inserted if playback speed is only changed for video sync correction. As of this commit, this is basically inactive code. It's just preparation for the video sync code (the following commit).
Diffstat (limited to 'player/core.h')
-rw-r--r--player/core.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/player/core.h b/player/core.h
index 75dd2edec7..092775f40e 100644
--- a/player/core.h
+++ b/player/core.h
@@ -238,6 +238,12 @@ typedef struct MPContext {
enum playback_status video_status, audio_status;
bool restart_complete;
+ // Factors to multiply with opts->playback_speed to get the total audio or
+ // video speed (usually 1.0, but can be set to by the sync code).
+ double speed_factor_v, speed_factor_a;
+ // Redundant values set from opts->playback_speed and speed_factor_*.
+ // update_playback_speed() updates them from the other fields.
+ double audio_speed, video_speed;
bool broken_fps_header;
/* Set if audio should be timed to start with video frame after seeking,
* not set when e.g. playing cover art */
@@ -362,7 +368,7 @@ double playing_audio_pts(struct MPContext *mpctx);
void fill_audio_out_buffers(struct MPContext *mpctx, double endpts);
double written_audio_pts(struct MPContext *mpctx);
void clear_audio_output_buffers(struct MPContext *mpctx);
-void set_playback_speed(struct MPContext *mpctx, double new_speed);
+void update_playback_speed(struct MPContext *mpctx);
void uninit_audio_out(struct MPContext *mpctx);
void uninit_audio_chain(struct MPContext *mpctx);