diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-08-20 09:39:04 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-08-24 04:23:50 +0200 |
commit | 88b3e3156231d9f45c816c26980a2048619e44c4 (patch) | |
tree | f2bbdfd3be3aac83d153a27519de30b2bd333363 | |
parent | 201b8a4d67f72c34c6d2b786f9cd51a546fae90e (diff) | |
download | ffmpeg-88b3e3156231d9f45c816c26980a2048619e44c4.tar.gz |
avformat/matroskaenc: Only compile functions when needed
Fixes unused function warnings in case e.g. the WebM muxer is disabled.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r-- | libavformat/matroskaenc.c | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index ad8a4698b8..b1735f3838 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -2632,33 +2632,6 @@ after_cues: return ret2; } -static int mkv_query_codec(enum AVCodecID codec_id, int std_compliance) -{ - int i; - for (i = 0; ff_mkv_codec_tags[i].id != AV_CODEC_ID_NONE; i++) - if (ff_mkv_codec_tags[i].id == codec_id) - return 1; - - if (std_compliance < FF_COMPLIANCE_NORMAL) { - enum AVMediaType type = avcodec_get_type(codec_id); - // mkv theoretically supports any video/audio through VFW/ACM - if (type == AVMEDIA_TYPE_VIDEO || type == AVMEDIA_TYPE_AUDIO) - return 1; - } - - return 0; -} - -static int webm_query_codec(enum AVCodecID codec_id, int std_compliance) -{ - int i; - for (i = 0; ff_webm_codec_tags[i].id != AV_CODEC_ID_NONE; i++) - if (ff_webm_codec_tags[i].id == codec_id) - return 1; - - return 0; -} - static uint64_t mkv_get_uid(const mkv_track *tracks, int i, AVLFG *c) { while (1) { @@ -2833,6 +2806,22 @@ static const AVClass matroska_webm_class = { }; #if CONFIG_MATROSKA_MUXER +static int mkv_query_codec(enum AVCodecID codec_id, int std_compliance) +{ + for (int i = 0; ff_mkv_codec_tags[i].id != AV_CODEC_ID_NONE; i++) + if (ff_mkv_codec_tags[i].id == codec_id) + return 1; + + if (std_compliance < FF_COMPLIANCE_NORMAL) { + enum AVMediaType type = avcodec_get_type(codec_id); + // mkv theoretically supports any video/audio through VFW/ACM + if (type == AVMEDIA_TYPE_VIDEO || type == AVMEDIA_TYPE_AUDIO) + return 1; + } + + return 0; +} + const AVOutputFormat ff_matroska_muxer = { .name = "matroska", .long_name = NULL_IF_CONFIG_SMALL("Matroska"), @@ -2862,6 +2851,15 @@ const AVOutputFormat ff_matroska_muxer = { #endif #if CONFIG_WEBM_MUXER +static int webm_query_codec(enum AVCodecID codec_id, int std_compliance) +{ + for (int i = 0; ff_webm_codec_tags[i].id != AV_CODEC_ID_NONE; i++) + if (ff_webm_codec_tags[i].id == codec_id) + return 1; + + return 0; +} + const AVOutputFormat ff_webm_muxer = { .name = "webm", .long_name = NULL_IF_CONFIG_SMALL("WebM"), |