* [FFmpeg-devel] [PR] avcodec/mlpenc: Mark unreachable cases as such (PR #21516)
@ 2026-01-19 14:24 mkver via ffmpeg-devel
0 siblings, 0 replies; only message in thread
From: mkver via ffmpeg-devel @ 2026-01-19 14:24 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: mkver
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 <andreas.rheinhardt@outlook.com>
Date: Mon, 19 Jan 2026 15:23:18 +0100
Subject: [PATCH] avcodec/mlpenc: Mark unreachable cases as such
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
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 -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-01-19 14:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-19 14:24 [FFmpeg-devel] [PR] avcodec/mlpenc: Mark unreachable cases as such (PR #21516) mkver via ffmpeg-devel
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git