diff mbox series

[FFmpeg-devel,4/4] avformat/matroskaenc: Only compile functions when needed

Message ID AM7PR03MB666096D511E7F9F506EF2D778FC19@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit 88b3e3156231d9f45c816c26980a2048619e44c4
Headers show
Series [FFmpeg-devel,1/4] avformat/matroskaenc: Allow to set multiple streams as default | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Aug. 20, 2021, 8:09 a.m. UTC
Fixes unused function warnings in case e.g. the WebM muxer is disabled.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/matroskaenc.c | 52 +++++++++++++++++++--------------------
 1 file changed, 25 insertions(+), 27 deletions(-)
diff mbox series

Patch

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"),