avformat/ast: Deduplicate codec tags lists

Also saves a relocation.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
Andreas Rheinhardt 2021-02-18 02:26:03 +01:00
parent a442670a32
commit 697066af01
4 changed files with 7 additions and 3 deletions

View File

@ -19,7 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include "avformat.h" #include <stddef.h>
#include "libavcodec/codec_id.h"
#include "internal.h" #include "internal.h"
const AVCodecTag ff_codec_ast_tags[] = { const AVCodecTag ff_codec_ast_tags[] = {
@ -27,3 +28,5 @@ const AVCodecTag ff_codec_ast_tags[] = {
{ AV_CODEC_ID_PCM_S16BE_PLANAR, 1 }, { AV_CODEC_ID_PCM_S16BE_PLANAR, 1 },
{ AV_CODEC_ID_NONE, 0 }, { AV_CODEC_ID_NONE, 0 },
}; };
const AVCodecTag *const ff_ast_codec_tags_list[] = { ff_codec_ast_tags, NULL };

View File

@ -26,5 +26,6 @@
#include "internal.h" #include "internal.h"
extern const AVCodecTag ff_codec_ast_tags[]; extern const AVCodecTag ff_codec_ast_tags[];
extern const AVCodecTag *const ff_ast_codec_tags_list[];
#endif /* AVFORMAT_AST_H */ #endif /* AVFORMAT_AST_H */

View File

@ -118,5 +118,5 @@ AVInputFormat ff_ast_demuxer = {
.read_packet = ast_read_packet, .read_packet = ast_read_packet,
.extensions = "ast", .extensions = "ast",
.flags = AVFMT_GENERIC_INDEX, .flags = AVFMT_GENERIC_INDEX,
.codec_tag = (const AVCodecTag* const []){ff_codec_ast_tags, 0}, .codec_tag = ff_ast_codec_tags_list,
}; };

View File

@ -207,5 +207,5 @@ AVOutputFormat ff_ast_muxer = {
.write_packet = ast_write_packet, .write_packet = ast_write_packet,
.write_trailer = ast_write_trailer, .write_trailer = ast_write_trailer,
.priv_class = &ast_muxer_class, .priv_class = &ast_muxer_class,
.codec_tag = (const AVCodecTag* const []){ff_codec_ast_tags, 0}, .codec_tag = ff_ast_codec_tags_list,
}; };