[FFmpeg-cvslog] avcodec/pcm: Remove always-false check
Andreas Rheinhardt
git at videolan.org
Mon Mar 17 04:24:44 EET 2025
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Tue Mar 11 17:26:43 2025 +0100| [5247090b0daa128d50eb03052a4abfd6c39bc7dc] | committer: Andreas Rheinhardt
avcodec/pcm: Remove always-false check
All codecs here have a valid sample size at this point.
This check has (presumably) been added for DVD PCM,
but even for them the check was always-true after
381e195b46d080aee1d9b05ef2b6b140e9463519 (and the DVD
code was later moved out altogether). So just remove
this check and the leftover DVD comment.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5247090b0daa128d50eb03052a4abfd6c39bc7dc
---
libavcodec/pcm.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c
index a23293dca2..5d8dcb8ff0 100644
--- a/libavcodec/pcm.c
+++ b/libavcodec/pcm.c
@@ -334,7 +334,6 @@ static int pcm_decode_frame(AVCodecContext *avctx, AVFrame *frame,
sample_size = av_get_bits_per_sample(avctx->codec_id) / 8;
- /* av_get_bits_per_sample returns 0 for AV_CODEC_ID_PCM_DVD */
samples_per_block = 1;
if (avctx->codec_id == AV_CODEC_ID_PCM_LXF) {
/* we process 40-bit blocks per channel for LXF */
@@ -342,11 +341,6 @@ static int pcm_decode_frame(AVCodecContext *avctx, AVFrame *frame,
sample_size = 5;
}
- if (sample_size == 0) {
- av_log(avctx, AV_LOG_ERROR, "Invalid sample_size\n");
- return AVERROR(EINVAL);
- }
-
if (channels == 0) {
av_log(avctx, AV_LOG_ERROR, "Invalid number of channels\n");
return AVERROR(EINVAL);
More information about the ffmpeg-cvslog
mailing list