mirror of
https://github.com/mpv-player/mpv
synced 2025-03-23 03:37:27 +00:00
Also reset time_frame and next_frame_time on reset, it makes no sense to
process the sleep before playing the frame seeked to and can be annoying when the user tries to escape a series of "stuck" frames with a huge duration. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30217 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
a7a1f395c6
commit
e57a8e1040
@ -72,6 +72,9 @@ typedef struct MPContext {
|
|||||||
// struct.
|
// struct.
|
||||||
int num_buffered_frames;
|
int num_buffered_frames;
|
||||||
|
|
||||||
|
// how long until we need to display the "current" frame
|
||||||
|
float time_frame;
|
||||||
|
|
||||||
// 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.
|
||||||
|
@ -2544,10 +2544,12 @@ static int seek(MPContext *mpctx, double amount, int style)
|
|||||||
resync_video_stream(mpctx->sh_video);
|
resync_video_stream(mpctx->sh_video);
|
||||||
if (vo_config_count)
|
if (vo_config_count)
|
||||||
mpctx->video_out->control(VOCTRL_RESET, NULL);
|
mpctx->video_out->control(VOCTRL_RESET, NULL);
|
||||||
|
mpctx->sh_video->next_frame_time = 0;
|
||||||
mpctx->sh_video->num_buffered_pts = 0;
|
mpctx->sh_video->num_buffered_pts = 0;
|
||||||
mpctx->sh_video->last_pts = MP_NOPTS_VALUE;
|
mpctx->sh_video->last_pts = MP_NOPTS_VALUE;
|
||||||
mpctx->num_buffered_frames = 0;
|
mpctx->num_buffered_frames = 0;
|
||||||
mpctx->delay = 0;
|
mpctx->delay = 0;
|
||||||
|
mpctx->time_frame = 0;
|
||||||
// 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).
|
||||||
@ -3610,7 +3612,6 @@ if(verbose) term_osd = 0;
|
|||||||
{
|
{
|
||||||
//int frame_corr_num=0; //
|
//int frame_corr_num=0; //
|
||||||
//float v_frame=0; // Video
|
//float v_frame=0; // Video
|
||||||
float time_frame=0; // Timer
|
|
||||||
//float num_frames=0; // number of frames played
|
//float num_frames=0; // number of frames played
|
||||||
|
|
||||||
int frame_time_remaining=0; // flag
|
int frame_time_remaining=0; // flag
|
||||||
@ -3778,7 +3779,7 @@ if(!mpctx->sh_video) {
|
|||||||
else {
|
else {
|
||||||
// might return with !eof && !blit_frame if !correct_pts
|
// might return with !eof && !blit_frame if !correct_pts
|
||||||
mpctx->num_buffered_frames += blit_frame;
|
mpctx->num_buffered_frames += blit_frame;
|
||||||
time_frame += frame_time / playback_speed; // for nosound
|
mpctx->time_frame += frame_time / playback_speed; // for nosound
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3809,7 +3810,7 @@ if(!mpctx->sh_video) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
frame_time_remaining = sleep_until_update(&time_frame, &aq_sleep_time);
|
frame_time_remaining = sleep_until_update(&mpctx->time_frame, &aq_sleep_time);
|
||||||
|
|
||||||
//====================== FLIP PAGE (VIDEO BLT): =========================
|
//====================== FLIP PAGE (VIDEO BLT): =========================
|
||||||
|
|
||||||
@ -3824,7 +3825,7 @@ if(!mpctx->sh_video) {
|
|||||||
}
|
}
|
||||||
//====================== A-V TIMESTAMP CORRECTION: =========================
|
//====================== A-V TIMESTAMP CORRECTION: =========================
|
||||||
|
|
||||||
adjust_sync_and_print_status(frame_time_remaining, time_frame);
|
adjust_sync_and_print_status(frame_time_remaining, mpctx->time_frame);
|
||||||
|
|
||||||
//============================ Auto QUALITY ============================
|
//============================ Auto QUALITY ============================
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user