From patchwork Thu Feb 18 03:42:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 25739 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 34E2644BC3E for ; Thu, 18 Feb 2021 05:43:16 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1525468A328; Thu, 18 Feb 2021 05:43:16 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4C3F768A3B7 for ; Thu, 18 Feb 2021 05:43:02 +0200 (EET) Received: by mail-wr1-f50.google.com with SMTP id t15so1089559wrx.13 for ; Wed, 17 Feb 2021 19:43:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=YYqnt0UKU9fM4IglZKVDvmXh3Ap8+A3etio7bhY9XwU=; b=YhAd6P2SBmQp5jgQBYvq9bkrFjTj9dGKGnUcXOEWmszGqBsjv9fBUsQDhEAQxLn4L4 jOYHXe4RFBL/v6jRc/eUDyMAfapp7SA+RaUuadl6jNmYuJfzcftnALLtTztmoWcTBGDK v1YeLK71csTqGLMzeUUoUO7PdhYAJzdjPtRn+xIMbCBY+2Jw4JPatbRpVxf3f3fmVmQT qXkcavX1b2Vz2JmPaRDHFrelYqA/Q4wtvKxF+uj8qh8WefsZJsupuUg8KOQSYYxLMzrn f802W4NjDcMByTwLOXg4jYSNM9CR9jWtmVfgYwMkuugCSFiNPtki9BhkpK5P4nHxLJ/I SjYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=YYqnt0UKU9fM4IglZKVDvmXh3Ap8+A3etio7bhY9XwU=; b=Q65QV1QuQnGG3ghNc3Ozkx26AF6KRxjrxubOwqEv8TcbLcNceZ98in6JB+f5AU40jk TaJmYbzQq/L4gXLGxboHqPg+gOMN5AlcCO54oljvRhrSGQnA6fE8q2xTzWyX9H2cjNJO SzHrunWBhAuiXp+chARw5NJRZTQuK9h1VbR3v30gB8+yvu7FQ0vDeURMlXgd6U2zhCSE bXEecxFnI2cSkxBt9vqI2fjGV9b5OcfvsmGOMKHp0Pqpc4tNAt1qBjmGyI6IsRuwje8h DbPLNntVITUab6AGUdDpJ6W0ceYxeiKvKM3AJLJ+TmGsEAJr1/F9j9NDuxKlG8c/lqKT jhvg== X-Gm-Message-State: AOAM5316aBFt8MOOC0PbZ+HimdfBDfebTL0N33xCa8zxFsrhJddFbTta q1evh+Eg6ziao3cPWfsJyHXqn7ZOJ3c= X-Google-Smtp-Source: ABdhPJyrLS5BVylOoYVDKRXi8Ltsj322HQCYKDt2oDH5MLY8g4BMMO/fvQNcvPRhgG3grnN27c4znA== X-Received: by 2002:a5d:4e09:: with SMTP id p9mr2191771wrt.346.1613619781566; Wed, 17 Feb 2021 19:43:01 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id p9sm5643855wmc.1.2021.02.17.19.43.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Feb 2021 19:43:01 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 18 Feb 2021 04:42:09 +0100 Message-Id: <20210218034214.2090223-24-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210218034214.2090223-1-andreas.rheinhardt@gmail.com> References: <20210218034214.2090223-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 24/29] avformat/movenc: Deduplicate codec tags lists X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Also saves relocations. Signed-off-by: Andreas Rheinhardt --- libavformat/movenc.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index f97383fcfe..545b0885ae 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -7131,6 +7131,7 @@ static int mov_check_bitstream(struct AVFormatContext *s, const AVPacket *pkt) return ret; } +#if CONFIG_TGP_MUXER || CONFIG_TG2_MUXER static const AVCodecTag codec_3gp_tags[] = { { AV_CODEC_ID_H263, MKTAG('s','2','6','3') }, { AV_CODEC_ID_H264, MKTAG('a','v','c','1') }, @@ -7141,6 +7142,8 @@ static const AVCodecTag codec_3gp_tags[] = { { AV_CODEC_ID_MOV_TEXT, MKTAG('t','x','3','g') }, { AV_CODEC_ID_NONE, 0 }, }; +static const AVCodecTag *const codec_3gp_tags_list[] = { codec_3gp_tags, NULL }; +#endif static const AVCodecTag codec_mp4_tags[] = { { AV_CODEC_ID_MPEG4, MKTAG('m', 'p', '4', 'v') }, @@ -7178,6 +7181,9 @@ static const AVCodecTag codec_mp4_tags[] = { { AV_CODEC_ID_MPEGH_3D_AUDIO, MKTAG('m', 'h', 'm', '1') }, { AV_CODEC_ID_NONE, 0 }, }; +#if CONFIG_MP4_MUXER || CONFIG_PSP_MUXER +static const AVCodecTag *const mp4_codec_tags_list[] = { codec_mp4_tags, NULL }; +#endif static const AVCodecTag codec_ism_tags[] = { { AV_CODEC_ID_WMAPRO , MKTAG('w', 'm', 'a', ' ') }, @@ -7242,7 +7248,7 @@ AVOutputFormat ff_tgp_muxer = { .write_trailer = mov_write_trailer, .deinit = mov_free, .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, - .codec_tag = (const AVCodecTag* const []){ codec_3gp_tags, 0 }, + .codec_tag = codec_3gp_tags_list, .check_bitstream = mov_check_bitstream, .priv_class = &tgp_muxer_class, }; @@ -7264,7 +7270,7 @@ AVOutputFormat ff_mp4_muxer = { .write_trailer = mov_write_trailer, .deinit = mov_free, .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, - .codec_tag = (const AVCodecTag* const []){ codec_mp4_tags, 0 }, + .codec_tag = mp4_codec_tags_list, .check_bitstream = mov_check_bitstream, .priv_class = &mp4_muxer_class, }; @@ -7285,7 +7291,7 @@ AVOutputFormat ff_psp_muxer = { .write_trailer = mov_write_trailer, .deinit = mov_free, .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, - .codec_tag = (const AVCodecTag* const []){ codec_mp4_tags, 0 }, + .codec_tag = mp4_codec_tags_list, .check_bitstream = mov_check_bitstream, .priv_class = &psp_muxer_class, }; @@ -7305,7 +7311,7 @@ AVOutputFormat ff_tg2_muxer = { .write_trailer = mov_write_trailer, .deinit = mov_free, .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, - .codec_tag = (const AVCodecTag* const []){ codec_3gp_tags, 0 }, + .codec_tag = codec_3gp_tags_list, .check_bitstream = mov_check_bitstream, .priv_class = &tg2_muxer_class, };