From ba170cafe1034780e6501419fcdecb913cc2e9b6 Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <randrianasulu@gmail.com>
Date: Fri, 17 Dec 2021 06:25:32 +0300
Subject: [PATCH 12/24] EXPERIMENTAL: attempt to get value from popuptextbox

---
 cinelerra-5.1/cinelerra/bdcreate.C | 7 +++++--
 cinelerra-5.1/cinelerra/bdcreate.h | 1 +
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/cinelerra-5.1/cinelerra/bdcreate.C b/cinelerra-5.1/cinelerra/bdcreate.C
index 90fb8734..291f7e7e 100644
--- a/cinelerra-5.1/cinelerra/bdcreate.C
+++ b/cinelerra-5.1/cinelerra/bdcreate.C
@@ -213,6 +213,8 @@ CreateBD_Thread::CreateBD_Thread(MWindow *mwindow)
 	this->use_labeled = 0;
 	this->use_farmed = 0;
 	this->use_termux = 0;
+	
+	strcpy(use_profile,"bluray.m2ts");
 
 	this->bd_size = BD_SIZE;
 	this->bd_width = BD_WIDTH;
@@ -325,7 +327,7 @@ int CreateBD_Thread::create_bd_jobs(ArrayList<BatchRenderJob*> *jobs, const char
 	strcpy(asset->fformat, "m2ts");
 
 	asset->audio_data = 1;
-	strcpy(asset->acodec, bd_profiles[0].name);
+	strcpy(asset->acodec, use_profile);
 	//mwindow->defaults->get("DEFAULT_BLURAY_ACODEC", asset->acodec);
 	FFMPEG::set_option_path(option_path, "audio/%s", asset->acodec);
 	FFMPEG::load_options(option_path, asset->ff_audio_options,
@@ -333,7 +335,7 @@ int CreateBD_Thread::create_bd_jobs(ArrayList<BatchRenderJob*> *jobs, const char
 	asset->ff_audio_bitrate = bd_kaudio_rate * 1000;
 
 	asset->video_data = 1;
-	const char *vcodec = bd_profiles[0].name;
+	const char *vcodec = use_profile;
 	switch( asset->interlace_mode ) {
 	case ILACE_MODE_TOP_FIRST:    vcodec = "bluray_tff.m2ts";  break;
 	case ILACE_MODE_BOTTOM_FIRST: vcodec = "bluray_bff.m2ts";  break;
@@ -1157,6 +1159,7 @@ CreateBD_Profile::~CreateBD_Profile()
 
 int CreateBD_Profile::handle_event()
 {
+	strcpy(gui->thread->use_profile, get_text());
 	return 1;
 }
 
diff --git a/cinelerra-5.1/cinelerra/bdcreate.h b/cinelerra-5.1/cinelerra/bdcreate.h
index 81f11120..e91d3c0a 100644
--- a/cinelerra-5.1/cinelerra/bdcreate.h
+++ b/cinelerra-5.1/cinelerra/bdcreate.h
@@ -57,6 +57,7 @@ public:
 	CreateBD_GUI *gui;
 	char asset_title[BCTEXTLEN];
 	char tmp_path[BCTEXTLEN];
+	char use_profile[BCTEXTLEN];
 	int use_deinterlace, use_inverse_telecine;
 	int use_scale, use_resize_tracks;
 	int use_wide_audio, use_farmed;
-- 
2.34.1

