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