From e25c6e6ba794a357c48fbdb87320a7ebd66c77d4 Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <randrianasulu@gmail.com>
Date: Fri, 6 Sep 2024 21:24:51 +0300
Subject: [PATCH] Avoid setcolorspacedetails if any yuv colormodels but model
 37

---
 cinelerra-5.1/cinelerra/ffmpeg.C | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cinelerra-5.1/cinelerra/ffmpeg.C b/cinelerra-5.1/cinelerra/ffmpeg.C
index 9b8832dd..5bbfebf8 100644
--- a/cinelerra-5.1/cinelerra/ffmpeg.C
+++ b/cinelerra-5.1/cinelerra/ffmpeg.C
@@ -1808,7 +1808,7 @@ int FFVideoConvert::convert_vframe_picture(VFrame *frame, AVFrame *op, AVFrame *
 	if( !sws_getColorspaceDetails(convert_ctx,
 			&inv_table, &src_range, &table, &dst_range,
 			&brightness, &contrast, &saturation) ) {
-		if( dst_range != color_range || table != color_table )
+		if(( dst_range != color_range || table != color_table) && (!BC_CModels::is_yuv(cmodel) && cmodel != 37))
 			sws_setColorspaceDetails(convert_ctx,
 					inv_table, src_range, color_table, color_range,
 					brightness, contrast, saturation);
-- 
2.39.4

