From e361b49b4acb9c66a60776d8d7bce6b5a399e157 Mon Sep 17 00:00:00 2001 From: yuchenlin Date: Sat, 10 Nov 2018 19:00:30 +0800 Subject: [PATCH] recorder: use av_oformat_next to support older FFmpeg Signed-off-by: yuchenlin --- app/src/recorder.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/recorder.c b/app/src/recorder.c index 5b9bae6d..84e1abe3 100644 --- a/app/src/recorder.c +++ b/app/src/recorder.c @@ -6,10 +6,16 @@ #include "log.h" static const AVOutputFormat *find_mp4_muxer(void) { +#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(58, 9, 100) void *opaque = NULL; - const AVOutputFormat *oformat; +#endif + const AVOutputFormat *oformat = NULL; do { +#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(58, 9, 100) oformat = av_muxer_iterate(&opaque); +#else + oformat = av_oformat_next(oformat); +#endif // until null or with name "mp4" } while (oformat && strcmp(oformat->name, "mp4")); return oformat;