From f679c5de1bc27ac87179b6ef3869319aeba5e3f4 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 4 Oct 2014 12:30:14 +0200 Subject: [PATCH] ad_lavc: avoid warning messages on older FFmpeg or Libav If the flag doesn't exist, the av_opt_set() API will print warning messages. --- audio/decode/ad_lavc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/audio/decode/ad_lavc.c b/audio/decode/ad_lavc.c index b138c5d69c..16a4ae45d0 100644 --- a/audio/decode/ad_lavc.c +++ b/audio/decode/ad_lavc.c @@ -156,8 +156,10 @@ static int init(struct dec_audio *da, const char *decoder) av_opt_set_double(lavc_context, "drc_scale", opts->ac3drc, AV_OPT_SEARCH_CHILDREN); +#if HAVE_AVFRAME_SKIP_SAMPLES // Let decoder add AV_FRAME_DATA_SKIP_SAMPLES. av_opt_set(lavc_context, "flags2", "+skip_manual", AV_OPT_SEARCH_CHILDREN); +#endif mp_set_avopts(da->log, lavc_context, opts->avopts);