PR #21516 opened by mkver URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21516 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21516.patch
>From 196179ea7c486519d3e565c556c580b3d51a3943 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Mon, 19 Jan 2026 15:23:18 +0100 Subject: [PATCH] avcodec/mlpenc: Mark unreachable cases as such Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavcodec/mlpenc.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/libavcodec/mlpenc.c b/libavcodec/mlpenc.c index 475a70c225..4d4c33f485 100644 --- a/libavcodec/mlpenc.c +++ b/libavcodec/mlpenc.c @@ -521,10 +521,7 @@ static av_cold int mlp_encode_init(AVCodecContext *avctx) ctx->fs = 0x10 + 2; break; default: - av_log(avctx, AV_LOG_ERROR, "Unsupported sample rate %d. Supported " - "sample rates are 44100, 88200, 176400, 48000, " - "96000, and 192000.\n", avctx->sample_rate); - return AVERROR(EINVAL); + av_unreachable("Checked via CODEC_SAMPLERATES"); } ctx->coded_sample_rate[1] = -1 & 0xf; @@ -547,9 +544,7 @@ static av_cold int mlp_encode_init(AVCodecContext *avctx) avctx->bits_per_raw_sample = 24; break; default: - av_log(avctx, AV_LOG_ERROR, "Sample format not supported. " - "Only 16- and 24-bit samples are supported.\n"); - return AVERROR(EINVAL); + av_unreachable("Checked via CODEC_SAMPLEFMTS"); } ctx->coded_sample_fmt[1] = -1 & 0xf; @@ -613,7 +608,7 @@ static av_cold int mlp_encode_init(AVCodecContext *avctx) ctx->thd_substream_info = 0x3C; break; default: - av_assert1(!"AVCodec.ch_layouts needs to be updated"); + av_unreachable("Checked via CODEC_CH_LAYOUTS"); } ctx->flags = 0; ctx->channel_occupancy = 0; -- 2.52.0 _______________________________________________ ffmpeg-devel mailing list -- [email protected] To unsubscribe send an email to [email protected]
