From: mkver via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: mkver <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PR] avcodec/mlpenc: Mark unreachable cases as such (PR #21516)
Date: Mon, 19 Jan 2026 14:24:05 -0000
Message-ID: <176883264556.25.2813716162665274468@4457048688e7> (raw)
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
reply other threads:[~2026-01-19 14:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=176883264556.25.2813716162665274468@4457048688e7 \
--to=ffmpeg-devel@ffmpeg.org \
--cc=code@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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