History

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.

Andreas Rheinhardt committed 1 year ago

Commit 52470901 parent 1eafbf81 file · +0 −6Browse files

Unified · Split

libavcodec/pcm.c+0−6
@@ -334,7 +334,6 @@ static int pcm_decode_frame(AVCodecContext *avctx, AVFrame *frame, · 333 unmodified lines
334334
335335 sample_size = av_get_bits_per_sample(avctx->codec_id) / 8;
336336
337− /* av_get_bits_per_sample returns 0 for AV_CODEC_ID_PCM_DVD */
338337 samples_per_block = 1;
339338 if (avctx->codec_id == AV_CODEC_ID_PCM_LXF) {
340339 /* we process 40-bit blocks per channel for LXF */
@@ -342,11 +341,6 @@ static int pcm_decode_frame(AVCodecContext *avctx, AVFrame *frame, · 1 unmodified line
342341 sample_size = 5;
343342 }
344343
345− if (sample_size == 0) {
346− av_log(avctx, AV_LOG_ERROR, "Invalid sample_size\n");
347− return AVERROR(EINVAL);
348− }
349−
350344 if (channels == 0) {
351345 av_log(avctx, AV_LOG_ERROR, "Invalid number of channels\n");
352346 return AVERROR(EINVAL);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t