Try this patch - should be valid git patch 
(previous patch was correct too, I hope, just you need to apply it
from within cinelerra directory ...

root@slax:/dev/shm/tmp/cinelerra-goodguy-20210119/cinelerra-5.1/cinelerra# cat 
/home/guest/botva/src/cinelerra-git/cin-5/batchrender_post_merge_raw_fix.diff | 
patch -p0
patching file batchrender.C

I remade diff with 
git diff batchrender.C > 
/home/guest/botva/src/cinelerra-git/cin-5/batchrender_post_merge_raw_fix_git.diff

now it compiles ..... will take some time (I applied all my patches via 
slackbuild, so soon I'll eat my own dog food ..:} * )


* - well, my dog Grey  died last december ..so I have a lot of time ..:/
diff --git a/cinelerra-5.1/cinelerra/batchrender.C b/cinelerra-5.1/cinelerra/batchrender.C
index 8a89c925..0c20b961 100644
--- a/cinelerra-5.1/cinelerra/batchrender.C
+++ b/cinelerra-5.1/cinelerra/batchrender.C
@@ -265,12 +265,29 @@ void BatchRenderThread::load_jobs(char *path, Preferences *preferences)
 	if( !path[0] ) create_path(path);
 	file.read_from_file(path);
 
+
+	    const char *cin_version = 0;
+	    while( !file.read_tag() ) {
+		if( file.tag.title_is("EDL") ) {
+		    cin_version = file.tag.get_property("VERSION");
+		    break;
+		}
+	    }
+	    file.rewind();
+	    if( cin_version ) {
+		printf(_("XML file %s\n IS project from cinelerra. \n You need batchrender-specific XML as argument for -r !!!! \n"), path);
+		if (!mwindow)
+		exit(1);
+	    }
+	    file.rewind();
+
+
 	while( !result ) {
 		if( !(result = file.read_tag()) ) {
 			if( file.tag.title_is("JOBS") ) {
-				if (mwindow->preferences->unsafe_gui)
+				if (mwindow && mwindow->preferences->unsafe_gui)
 				warn = file.tag.get_property("WARN", 1);
-				if (!mwindow->preferences->unsafe_gui)
+				if (mwindow && !mwindow->preferences->unsafe_gui)
 				warn = 0;
 			}
 			else if( file.tag.title_is("JOB") ) {
@@ -296,7 +313,7 @@ void BatchRenderThread::save_jobs(char *path)
 {
 	FileXML file;
 	file.tag.set_title("JOBS");
-	if (mwindow->preferences->unsafe_gui)
+	if (mwindow && mwindow->preferences->unsafe_gui)
 	file.tag.set_property("WARN", warn);
 	file.append_tag();
 	file.append_newline();
-- 
Cin mailing list
Cin@lists.cinelerra-gg.org
https://lists.cinelerra-gg.org/mailman/listinfo/cin

Reply via email to