From patchwork Thu Feb 18 03:42:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 25748 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 946EB44A234 for ; Thu, 18 Feb 2021 05:46:14 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3FB2C68A0F1; Thu, 18 Feb 2021 05:43:13 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DD26668A0BE for ; Thu, 18 Feb 2021 05:43:00 +0200 (EET) Received: by mail-wr1-f47.google.com with SMTP id b3so1161763wrj.5 for ; Wed, 17 Feb 2021 19:43:00 -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=kQ8hUBZBaqyWCFIrTJhe2QhOJi6Z4Cu3aNxA4CeQthA=; b=hOTGVQ0xmRP80SMRKgfqrukgwx9NFfWhQdRSa4wwJKQsaiNqc8ov6+TC/rUkPcNeE8 BoBaOa9GJSDafVT51E1u8WNu7Mfs4MHFvwcijYHOzU2uDRFEOSgSu5GuXIlQVdSMb0sz T3FqTcGv/klfUoknXWVxzoA6GLAZydD31Bm4gxTMdofYJkrWdtmFFpG1tE56/iRkZ1mr 8ELpKaDBumUImBOKNXHXvfs9n/66bta52B49QlpdmYVaPzUhtgUPQ5b4bgf76YjlczwT H33t/FPZLFYCbQT2F8ebZTs3I1xvwd9+EJloObYCpu/CHQ6orLMOlHVHc6U+VtaqVo/E Y4NQ== 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=kQ8hUBZBaqyWCFIrTJhe2QhOJi6Z4Cu3aNxA4CeQthA=; b=qdsidNhIj9NFuIJguXPCyKP+B3SOOsW69YDAIC+5yG4e5cb/F6nMntrIjDLMk4yjOl AuLsxuQLxJ+cwi7GboV2LIhq+ErtSY38OOw3RewKblJKlmMPPMhi3SUmJEAvV+DlTyJi qrt5AD05mmIGKpli7tnRNUiNEpx4DqbZT4UG0LMz7lQOp/rMQyt6bBU/ZAHs+Bdu1O/B VICKHbdA+81Fl2RtLKdGYKukEJgB19xi8faZiQD1gEs5or5vN5LoHy3Ok5eWBQW/X9lE XvMOZk0hfFjVwF2YY//nv/BPcC9YPUHj98rlFuNFcoi3xaaD/FCJSxR3OEBJZpAp9P/s 714g== X-Gm-Message-State: AOAM5313yP10QALv+Gf/odQc3TWPibjp9yknGS/a/3gTkG3TuYaZyk0s c8Oe3boCUlTyqdzdCAZlGS5NmCt6WfQ= X-Google-Smtp-Source: ABdhPJx4XeVfGK4DP5izwuTn24UqUEzEvxSn+UyN8YPXPdPoKkflYt7waXsg6+NhYzbwIQ6skyRYcg== X-Received: by 2002:a5d:4046:: with SMTP id w6mr2059357wrp.223.1613619780243; Wed, 17 Feb 2021 19:43:00 -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.42.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Feb 2021 19:42:59 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 18 Feb 2021 04:42:07 +0100 Message-Id: <20210218034214.2090223-22-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 22/29] avformat/oma: Deduplicate codec tags list 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 a relocation. Signed-off-by: Andreas Rheinhardt --- libavformat/oma.c | 3 +++ libavformat/oma.h | 1 + libavformat/omadec.c | 2 +- libavformat/omaenc.c | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libavformat/oma.c b/libavformat/oma.c index f7ae3c9948..e7bf8553f0 100644 --- a/libavformat/oma.c +++ b/libavformat/oma.c @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include "internal.h" #include "oma.h" #include "libavcodec/avcodec.h" @@ -35,6 +36,8 @@ const AVCodecTag ff_oma_codec_tags[] = { { 0 }, }; +const AVCodecTag *const ff_oma_codec_tags_list[] = { ff_oma_codec_tags, NULL }; + /** map ATRAC-X channel id to internal channel layout */ const uint64_t ff_oma_chid_to_native_layout[7] = { AV_CH_LAYOUT_MONO, diff --git a/libavformat/oma.h b/libavformat/oma.h index 36fd0125e4..5df50c8eb4 100644 --- a/libavformat/oma.h +++ b/libavformat/oma.h @@ -42,6 +42,7 @@ enum { extern const uint16_t ff_oma_srate_tab[8]; extern const AVCodecTag ff_oma_codec_tags[]; +extern const AVCodecTag *const ff_oma_codec_tags_list[]; extern const uint64_t ff_oma_chid_to_native_layout[7]; extern const int ff_oma_chid_to_num_channels[7]; diff --git a/libavformat/omadec.c b/libavformat/omadec.c index 5675d86e75..0b36d4e867 100644 --- a/libavformat/omadec.c +++ b/libavformat/omadec.c @@ -621,5 +621,5 @@ AVInputFormat ff_oma_demuxer = { .read_close = oma_read_close, .flags = AVFMT_GENERIC_INDEX, .extensions = "oma,omg,aa3", - .codec_tag = (const AVCodecTag* const []){ff_oma_codec_tags, 0}, + .codec_tag = ff_oma_codec_tags_list, }; diff --git a/libavformat/omaenc.c b/libavformat/omaenc.c index 7952808bf8..d3c4f62027 100644 --- a/libavformat/omaenc.c +++ b/libavformat/omaenc.c @@ -102,6 +102,6 @@ AVOutputFormat ff_oma_muxer = { .audio_codec = AV_CODEC_ID_ATRAC3, .write_header = oma_write_header, .write_packet = ff_raw_write_packet, - .codec_tag = (const AVCodecTag* const []){ff_oma_codec_tags, 0}, + .codec_tag = ff_oma_codec_tags_list, .flags = AVFMT_NOTIMESTAMPS, };