From 8dfe0c73c9293dbbbfae096e0fbd6e59ecbd3896 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 9 Aug 2014 00:35:25 +0200 Subject: video: remove "hard" framedrop mode Completely useless, and could accidentally be enabled by cycling framedrop modes. Just get rid of it. But still allow triggering the old code with --vd-lavc-framedrop, in case someone asks for it. If nobody does, this new option will be removed eventually. --- video/decode/vd_lavc.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'video') diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 75f66ce1f1..de5c1eb672 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -75,6 +75,7 @@ struct vd_lavc_params { int skip_loop_filter; int skip_idct; int skip_frame; + int framedrop; int threads; int bitexact; int check_hw_profile; @@ -101,6 +102,7 @@ const struct m_sub_options vd_lavc_conf = { OPT_DISCARD("skiploopfilter", skip_loop_filter, 0), OPT_DISCARD("skipidct", skip_idct, 0), OPT_DISCARD("skipframe", skip_frame, 0), + OPT_DISCARD("framedrop", framedrop, 0), OPT_INTRANGE("threads", threads, 0, 0, 16), OPT_FLAG("bitexact", bitexact, 0), OPT_FLAG("check-hw-profile", check_hw_profile, 0), @@ -114,6 +116,7 @@ const struct m_sub_options vd_lavc_conf = { .skip_loop_filter = AVDISCARD_DEFAULT, .skip_idct = AVDISCARD_DEFAULT, .skip_frame = AVDISCARD_DEFAULT, + .framedrop = AVDISCARD_NONREF, }, }; @@ -592,14 +595,16 @@ static int decode(struct dec_video *vd, struct demux_packet *packet, int ret; vd_ffmpeg_ctx *ctx = vd->priv; AVCodecContext *avctx = ctx->avctx; + struct vd_lavc_params *lavc_param = ctx->opts->vd_lavc_params; AVPacket pkt; - if (flags & 2) - avctx->skip_frame = AVDISCARD_ALL; - else if (flags & 1) - avctx->skip_frame = AVDISCARD_NONREF; - else + if (flags) { + // hr-seek framedrop vs. normal framedrop + avctx->skip_frame = flags == 2 ? AVDISCARD_NONREF : lavc_param->framedrop; + } else { + // normal playback avctx->skip_frame = ctx->skip_frame; + } mp_set_av_packet(&pkt, packet, NULL); -- cgit v1.2.3