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

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to