You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
ffplay: update frame timer based on last updated clock time when toggling pause
It is better than using simply video clock, because video clock may be NAN. Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
2
ffplay.c
2
ffplay.c
@@ -1494,7 +1494,7 @@ static void stream_seek(VideoState *is, int64_t pos, int64_t rel, int seek_by_by
|
|||||||
static void stream_toggle_pause(VideoState *is)
|
static void stream_toggle_pause(VideoState *is)
|
||||||
{
|
{
|
||||||
if (is->paused) {
|
if (is->paused) {
|
||||||
is->frame_timer += av_gettime_relative() / 1000000.0 + is->vidclk.pts_drift - is->vidclk.pts;
|
is->frame_timer += av_gettime_relative() / 1000000.0 - is->vidclk.last_updated;
|
||||||
if (is->read_pause_return != AVERROR(ENOSYS)) {
|
if (is->read_pause_return != AVERROR(ENOSYS)) {
|
||||||
is->vidclk.paused = 0;
|
is->vidclk.paused = 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user