From 8eaf6c42ac9df1a3e5ef7385887b708d7cfbac28 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 8 Feb 2014 01:04:37 +0100 Subject: [PATCH] demux_lavf: work around idiotic libavutil API printing a warning Trying to set a non-existent flag (like +keepside on Libav) causes libavutil print an incomprehensible warning (something about eval; probably the overengineered libavutil option parser tripping over the '+' normally used for flags, and trying to interpret it as formula). There's apparently no easy way to check for the existence of a flag, so add some more ifdeffery to shut it up. --- demux/demux_lavf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index ad183629ff..e3ac84b50d 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -560,9 +560,13 @@ static int demux_open_lavf(demuxer_t *demuxer, enum demux_check check) avfc->flags |= AVFMT_FLAG_GENPTS; if (opts->index_mode == 0) avfc->flags |= AVFMT_FLAG_IGNIDX; + +#if LIBAVFORMAT_VERSION_MICRO >= 100 /* Keep side data as side data instead of mashing it into the packet - * stream. */ + * stream. + * Note: Libav doesn't have this horrible insanity. */ av_opt_set(avfc, "fflags", "+keepside", 0); +#endif if (lavfdopts->probesize) { if (av_opt_set_int(avfc, "probesize", lavfdopts->probesize, 0) < 0)