From d67b7feecd9f6a0719b86e44a8fb369845488236 Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <randrianasulu@gmail.com>
Date: Thu, 5 Feb 2026 20:15:38 +0300
Subject: [PATCH] Allow 16bpc only with ALLOW_OLD_16BPC env. var

---
 cinelerra-5.1/cinelerra/mwindow.C | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C
index 79ef7b35..0cb1e23b 100644
--- a/cinelerra-5.1/cinelerra/mwindow.C
+++ b/cinelerra-5.1/cinelerra/mwindow.C
@@ -1710,16 +1710,20 @@ void MWindow::init_channeldb()
 void MWindow::init_menus()
 {
 	char string[BCTEXTLEN];
+	int allow_old_16bpc = 0;
+	if (getenv("ALLOW_OLD_16BPC")) allow_old_16bpc = 1;
 
 	// Color Models
 	BC_CModels::to_text(string, BC_RGB888);
 	colormodels.append(new ColormodelItem(string, BC_RGB888));
 	BC_CModels::to_text(string, BC_RGBA8888);
 	colormodels.append(new ColormodelItem(string, BC_RGBA8888));
-//	BC_CModels::to_text(string, BC_RGB161616);
-//	colormodels.append(new ColormodelItem(string, BC_RGB161616));
-//	BC_CModels::to_text(string, BC_RGBA16161616);
-//	colormodels.append(new ColormodelItem(string, BC_RGBA16161616));
+if(allow_old_16bpc) {
+	BC_CModels::to_text(string, BC_RGB161616);
+	colormodels.append(new ColormodelItem(string, BC_RGB161616));
+	BC_CModels::to_text(string, BC_RGBA16161616);
+	colormodels.append(new ColormodelItem(string, BC_RGBA16161616));
+}
 	BC_CModels::to_text(string, BC_RGB_FLOAT);
 	colormodels.append(new ColormodelItem(string, BC_RGB_FLOAT));
 	BC_CModels::to_text(string, BC_RGBA_FLOAT);
@@ -1728,10 +1732,12 @@ void MWindow::init_menus()
 	colormodels.append(new ColormodelItem(string, BC_YUV888));
 	BC_CModels::to_text(string, BC_YUVA8888);
 	colormodels.append(new ColormodelItem(string, BC_YUVA8888));
+if(allow_old_16bpc) {
 	BC_CModels::to_text(string, BC_YUV161616);
 	colormodels.append(new ColormodelItem(string, BC_YUV161616));
 	BC_CModels::to_text(string, BC_YUVA16161616);
 	colormodels.append(new ColormodelItem(string, BC_YUVA16161616));
+}
 
 #define ILACEPROJECTMODELISTADD(x) ilacemode_to_text(string, x); \
                            interlace_project_modes.append(new InterlacemodeItem(string, x));
-- 
2.53.0

