[FFmpeg-devel] [PATCH 1/3] avformat/mxfenc: Replace more literal magic numbers by enum values.

Tomas Härdin tjoppen at acc.umu.se
Sun Sep 10 23:28:05 EEST 2017


On Sun, 2017-09-10 at 22:10 +0200, Michael Niedermayer wrote:
>  enum {
>      INDEX_MPEG2 = 0,
>      INDEX_AES3,
> @@ -159,6 +139,26 @@ enum {
>      INDEX_H264,
>  };
>  
> +static const struct {
> +    enum AVCodecID id;
> +    int index;
> +} mxf_essence_mappings[] = {
> +    { AV_CODEC_ID_MPEG2VIDEO, INDEX_MPEG2 },
> +    { AV_CODEC_ID_PCM_S24LE,  INDEX_AES3 },
> +    { AV_CODEC_ID_PCM_S16LE,  INDEX_AES3 },
> +    { AV_CODEC_ID_DVVIDEO,    INDEX_DV },
> +    { AV_CODEC_ID_DNXHD,      INDEX_DNXHD_1080p_10bit_HIGH },
> +    { AV_CODEC_ID_JPEG2000,   INDEX_JPEG2000 },
> +    { AV_CODEC_ID_H264,       INDEX_H264 },
> +    { AV_CODEC_ID_NONE }
> +};

This is tangentally relevant perhaps, but that INDEX_ enum should
really be type. Something like ULIndex and a comment with reference to
relevant spec section would be nice

/Tomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170910/7c7de667/attachment.sig>


More information about the ffmpeg-devel mailing list