From 37b55ee08fbb6ace19b4c07c5205678779c70858 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Wed, 1 Mar 2023 10:42:04 +0100 Subject: [PATCH] swresample: account for clip protection when determining the mixing matrix maximum --- libswresample/rematrix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswresample/rematrix.c b/libswresample/rematrix.c index b095e2d34f..11e5d1adb5 100644 --- a/libswresample/rematrix.c +++ b/libswresample/rematrix.c @@ -424,7 +424,7 @@ av_cold static int auto_matrix(SwrContext *s) if (s->rematrix_maxval > 0) { maxval = s->rematrix_maxval; - } else if ( av_get_packed_sample_fmt(s->out_sample_fmt) < AV_SAMPLE_FMT_FLT + } else if ( (av_get_packed_sample_fmt(s->out_sample_fmt) < AV_SAMPLE_FMT_FLT && !s->clip_protection) || av_get_packed_sample_fmt(s->int_sample_fmt) < AV_SAMPLE_FMT_FLT) { maxval = 1.0; } else