mirror of https://github.com/mpv-player/mpv
core: rename update_video_immediately->restart_playback
This commit is contained in:
parent
523a48d8a9
commit
3283ba0ccb
|
@ -122,9 +122,9 @@ typedef struct MPContext {
|
||||||
mixer_t mixer;
|
mixer_t mixer;
|
||||||
struct vo *video_out;
|
struct vo *video_out;
|
||||||
|
|
||||||
// Show a video frame as quickly as possible without trying to adjust
|
/* We're starting playback from scratch or after a seek. Show first
|
||||||
// for AV sync. Used when starting a file or after seeking.
|
* video frame immediately and reinitialize sync. */
|
||||||
bool update_video_immediately;
|
bool restart_playback;
|
||||||
// AV sync: the next frame should be shown when the audio out has this
|
// AV sync: the next frame should be shown when the audio out has this
|
||||||
// much (in seconds) buffered data left. Increased when more data is
|
// much (in seconds) buffered data left. Increased when more data is
|
||||||
// written to the ao, decreased when moving to the next frame.
|
// written to the ao, decreased when moving to the next frame.
|
||||||
|
|
12
mplayer.c
12
mplayer.c
|
@ -1881,7 +1881,7 @@ static int check_framedrop(struct MPContext *mpctx, double frame_time) {
|
||||||
// we should avoid dropping too many frames in sequence unless we
|
// we should avoid dropping too many frames in sequence unless we
|
||||||
// are too late. and we allow 100ms A-V delay here:
|
// are too late. and we allow 100ms A-V delay here:
|
||||||
if (d < -dropped_frames*frame_time-0.100 && !mpctx->paused
|
if (d < -dropped_frames*frame_time-0.100 && !mpctx->paused
|
||||||
&& !mpctx->update_video_immediately) {
|
&& !mpctx->restart_playback) {
|
||||||
++drop_frame_cnt;
|
++drop_frame_cnt;
|
||||||
++dropped_frames;
|
++dropped_frames;
|
||||||
return frame_dropping;
|
return frame_dropping;
|
||||||
|
@ -2417,7 +2417,7 @@ static double update_video_nocorrect_pts(struct MPContext *mpctx)
|
||||||
continue;
|
continue;
|
||||||
unsigned char *packet = NULL;
|
unsigned char *packet = NULL;
|
||||||
frame_time = sh_video->next_frame_time;
|
frame_time = sh_video->next_frame_time;
|
||||||
if (mpctx->update_video_immediately)
|
if (mpctx->restart_playback)
|
||||||
frame_time = 0;
|
frame_time = 0;
|
||||||
int in_size = video_read_frame(sh_video, &sh_video->next_frame_time,
|
int in_size = video_read_frame(sh_video, &sh_video->next_frame_time,
|
||||||
&packet, force_fps);
|
&packet, force_fps);
|
||||||
|
@ -2726,7 +2726,7 @@ static void seek_reset(struct MPContext *mpctx)
|
||||||
mpctx->sh_video->last_pts = MP_NOPTS_VALUE;
|
mpctx->sh_video->last_pts = MP_NOPTS_VALUE;
|
||||||
mpctx->delay = 0;
|
mpctx->delay = 0;
|
||||||
mpctx->time_frame = 0;
|
mpctx->time_frame = 0;
|
||||||
mpctx->update_video_immediately = true;
|
mpctx->restart_playback = true;
|
||||||
// Not all demuxers set d_video->pts during seek, so this value
|
// Not all demuxers set d_video->pts during seek, so this value
|
||||||
// (which is used by at least vobsub and edl code below) may
|
// (which is used by at least vobsub and edl code below) may
|
||||||
// be completely wrong (probably 0).
|
// be completely wrong (probably 0).
|
||||||
|
@ -4159,7 +4159,7 @@ if (mpctx->stream->type == STREAMTYPE_DVDNAV) {
|
||||||
get_relative_time(mpctx); // reset current delta
|
get_relative_time(mpctx); // reset current delta
|
||||||
mpctx->time_frame = 0;
|
mpctx->time_frame = 0;
|
||||||
mpctx->drop_message_shown = 0;
|
mpctx->drop_message_shown = 0;
|
||||||
mpctx->update_video_immediately = true;
|
mpctx->restart_playback = true;
|
||||||
mpctx->total_avsync_change = 0;
|
mpctx->total_avsync_change = 0;
|
||||||
mpctx->last_chapter_seek = -1;
|
mpctx->last_chapter_seek = -1;
|
||||||
// Make sure VO knows current pause state
|
// Make sure VO knows current pause state
|
||||||
|
@ -4238,9 +4238,9 @@ if(!mpctx->sh_video) {
|
||||||
if (frame_time < 0)
|
if (frame_time < 0)
|
||||||
mpctx->stop_play = AT_END_OF_FILE;
|
mpctx->stop_play = AT_END_OF_FILE;
|
||||||
else {
|
else {
|
||||||
if (mpctx->update_video_immediately) {
|
if (mpctx->restart_playback) {
|
||||||
// Show this frame immediately, rest normally
|
// Show this frame immediately, rest normally
|
||||||
mpctx->update_video_immediately = false;
|
mpctx->restart_playback = false;
|
||||||
} else {
|
} else {
|
||||||
mpctx->time_frame += frame_time / opts->playback_speed;
|
mpctx->time_frame += frame_time / opts->playback_speed;
|
||||||
adjust_sync(mpctx, frame_time);
|
adjust_sync(mpctx, frame_time);
|
||||||
|
|
Loading…
Reference in New Issue