From 2059ba2c40c4c696713f56c7e69285a265a8adb4 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 30 Dec 2015 15:51:47 +0100 Subject: video: do not disable hr-seek framedrop too early This didn't make too much sense, and just made seeking slower. Strictly suggest the decoder to drop a frame if its PTS is before the seek target. --- player/video.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'player/video.c') diff --git a/player/video.c b/player/video.c index 84981b1144..70c12e63c0 100644 --- a/player/video.c +++ b/player/video.c @@ -391,15 +391,13 @@ static int decode_image(struct MPContext *mpctx) struct demux_packet *pkt; if (demux_read_packet_async(d_video->header, &pkt) == 0) return VD_WAIT; - if ((pkt && pkt->pts >= mpctx->hrseek_pts - .005) || - d_video->has_broken_packet_pts || - !mpctx->opts->hr_seek_framedrop) + bool hrseek = mpctx->hrseek_active && mpctx->video_status == STATUS_SYNCING; + int framedrop_type = check_framedrop(mpctx); + if (hrseek && pkt && pkt->pts < mpctx->hrseek_pts - .005 && + !d_video->has_broken_packet_pts && mpctx->opts->hr_seek_framedrop) { - mpctx->hrseek_framedrop = false; + framedrop_type = 2; } - bool hrseek = mpctx->hrseek_active && mpctx->video_status == STATUS_SYNCING; - int framedrop_type = hrseek && mpctx->hrseek_framedrop ? - 2 : check_framedrop(mpctx); d_video->waiting_decoded_mpi = video_decode(d_video, pkt, framedrop_type); bool had_packet = !!pkt; -- cgit v1.2.3