summaryrefslogtreecommitdiffstats
path: root/player/loadfile.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-30 23:01:55 +0200
committerwm4 <wm4@nowhere>2014-07-30 23:29:00 +0200
commit8f2e9f1d613f686a834446c73465f0ca41156db3 (patch)
treedffb9d92c1764b7c6b7bd829e919e68f1be10bb1 /player/loadfile.c
parentc38013bffb130fbd60c57348a15ad1d6759c1806 (diff)
downloadmpv-8f2e9f1d613f686a834446c73465f0ca41156db3.tar.bz2
mpv-8f2e9f1d613f686a834446c73465f0ca41156db3.tar.xz
player: split seek_reset()
This also reduces some code duplication with other parts of the code. The changfe is mostly cosmetic, although there are also some subtle changes in behavior. At least one change is that the big desync message is now printed after every seek.
Diffstat (limited to 'player/loadfile.c')
-rw-r--r--player/loadfile.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index e26968000b..bcb9e900de 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -1251,8 +1251,6 @@ goto_reopen_demuxer: ;
MP_VERBOSE(mpctx, "Starting playback...\n");
- mpctx->drop_frame_cnt = 0;
- mpctx->dropped_frames = 0;
mpctx->max_frames = opts->play_frames;
if (mpctx->max_frames == 0) {
@@ -1260,27 +1258,18 @@ goto_reopen_demuxer: ;
goto terminate_playback;
}
- mpctx->time_frame = 0;
- mpctx->drop_message_shown = 0;
- mpctx->video_pts = 0;
+ reset_playback_state(mpctx);
+
mpctx->last_vo_pts = MP_NOPTS_VALUE;
- mpctx->last_frame_duration = 0;
- mpctx->last_seek_pts = 0;
- mpctx->playback_pts = MP_NOPTS_VALUE;
- mpctx->hrseek_active = false;
- mpctx->hrseek_framedrop = false;
- mpctx->step_frames = 0;
- mpctx->backstep_active = false;
- mpctx->total_avsync_change = 0;
mpctx->last_chapter_seek = -2;
- mpctx->playing_msg_shown = false;
+ mpctx->last_chapter_pts = MP_NOPTS_VALUE;
+ mpctx->last_chapter = -2;
mpctx->paused = false;
mpctx->paused_for_cache = false;
- mpctx->last_chapter = -2;
+ mpctx->playing_msg_shown = false;
+ mpctx->step_frames = 0;
+ mpctx->backstep_active = false;
mpctx->seek = (struct seek_params){ 0 };
- mpctx->video_status = mpctx->d_video ? STATUS_SYNCING : STATUS_EOF;
- mpctx->audio_status = mpctx->d_audio ? STATUS_SYNCING : STATUS_EOF;
- mpctx->restart_complete = false;
// If there's a timeline force an absolute seek to initialize state
double startpos = rel_time_to_abs(mpctx, opts->play_start);