[FFmpeg-devel] [PATCH 1/6] avformat/movenc: add PCM in mp4 support
Tomas Härdin
git at haerdin.se
Fri Feb 24 11:41:51 EET 2023
fre 2023-02-24 klockan 20:25 +0800 skrev Zhao Zhili:
> +static int is_mp4_pcm_codec(enum AVCodecID codec)
> +{
> + static const enum AVCodecID codec_list[] = {
> + AV_CODEC_ID_PCM_S16BE,
> + AV_CODEC_ID_PCM_S16LE,
> + AV_CODEC_ID_PCM_S24BE,
> + AV_CODEC_ID_PCM_S24LE,
> + AV_CODEC_ID_PCM_S32BE,
> + AV_CODEC_ID_PCM_S32LE,
> +
> + AV_CODEC_ID_PCM_F32BE,
> + AV_CODEC_ID_PCM_F32LE,
> + AV_CODEC_ID_PCM_F64BE,
> + AV_CODEC_ID_PCM_F64LE,
> + };
> +
> + for (int i = 0; i < FF_ARRAY_ELEMS(codec_list); i++) {
> + if (codec == codec_list[i])
> + return 1;
> + }
A switch() with multiple case statements in a row would be more
concise.
The rest looks OK
/Tomas
More information about the ffmpeg-devel
mailing list