summaryrefslogtreecommitdiff
path: root/libavcodec/mlpenc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-09-17 23:49:57 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-09-22 01:16:49 +0200
commit65dbc83eec2656786b901ed15569d7044c6c6dee (patch)
tree83afb4fc5ca9c312c15d646091d225a53de11c50 /libavcodec/mlpenc.c
parenta12338afe5192f23349c0fde8592891be230bfc3 (diff)
downloadffmpeg-65dbc83eec2656786b901ed15569d7044c6c6dee.tar.gz
avcodec/mlpenc: Remove dead channel layout checks
ff_encode_preinit() has already checked that the channel layout is equivalent to one of the layouts in AVCodec.ch_layouts. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/mlpenc.c')
-rw-r--r--libavcodec/mlpenc.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/libavcodec/mlpenc.c b/libavcodec/mlpenc.c
index 18e8ce4579..a8b0486cf3 100644
--- a/libavcodec/mlpenc.c
+++ b/libavcodec/mlpenc.c
@@ -27,6 +27,7 @@
#include "encode.h"
#include "put_bits.h"
#include "audio_frame_queue.h"
+#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"
#include "libavutil/crc.h"
#include "libavutil/avstring.h"
@@ -602,12 +603,11 @@ static av_cold int mlp_encode_init(AVCodecContext *avctx)
};
int i;
- for (i = 0; i < FF_ARRAY_ELEMS(layout_arrangement); i++)
+ for (i = 0;; i++) {
+ av_assert1(i < FF_ARRAY_ELEMS(layout_arrangement) ||
+ !"Impossible channel layout");
if (channels_present == layout_arrangement[i])
break;
- if (i == FF_ARRAY_ELEMS(layout_arrangement)) {
- av_log(avctx, AV_LOG_ERROR, "Unsupported channel arrangement\n");
- return AVERROR(EINVAL);
}
ctx->channel_arrangement = i;
ctx->flags = FLAGS_DVDA;
@@ -640,8 +640,7 @@ static av_cold int mlp_encode_init(AVCodecContext *avctx)
ctx->channel_arrangement = 15;
ctx->thd_substream_info = 0x104;
} else {
- av_log(avctx, AV_LOG_ERROR, "Unsupported channel arrangement\n");
- return AVERROR(EINVAL);
+ av_assert1(!"AVCodec.ch_layouts needs to be updated");
}
ctx->flags = 0;
ctx->channel_occupancy = 0;