From: Good Guy <good1.2guy@gmail.com>
Date: Tue, 23 Feb 2016 19:35:28 +0000 (-0700)
Subject: fix plugin probe when LANG != en
X-Git-Url: http://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=a9f2ea113da20b8cfbe4f394d69dc1e8315ddddd;p=goodguy%2Fhistory.git

fix plugin probe when LANG != en
---

diff --git a/cinelerra-5.0/build/Makefile.cinelerra b/cinelerra-5.0/build/Makefile.cinelerra
index 761f57f2..6537a5ea 100644
--- a/cinelerra-5.0/build/Makefile.cinelerra
+++ b/cinelerra-5.0/build/Makefile.cinelerra
@@ -46,15 +46,21 @@ dist-clean:
 #	find \( -name .deps \) -exec rm -rf {} \; -prune
 	find \( -name .libs \) -exec rm -rf {} \; -prune
 
-MJPEGDIR := $(shell expr thirdparty/mjpegtools* )
+MJPEGDIR := $(shell expr $(THIRDPARTY)/mjpegtools* )
+MPEG2ENC := bin/mpeg2enc
+MPEG2PLEX := bin/mplex
+HVEG2ENC := bin/hveg2enc
 
-$(PLUGIN_DIR)/mpeg2enc.plugin:
-	/bin/cp -a $(MJPEGDIR)/mpeg2enc/mpeg2enc $@
+$(MPEG2ENC):
+	cp -a $(MJPEGDIR)/mpeg2enc/mpeg2enc $@
 
-bin/mplex:
-	/bin/cp -a $(MJPEGDIR)/mplex/mplex $@
+$(MPEG2PLEX):
+	cp -a $(MJPEGDIR)/mplex/mplex $@
 
-install:	$(PLUGIN_DIR)/mpeg2enc.plugin bin/mplex
+$(HVEG2ENC):
+	cp -a $(TOPDIR)/mpeg2enc/$(OBJDIR)/hveg2enc $@
+
+install:	$(MPEG2PLEX) $(MPEG2ENC) $(HVEG2ENC)
 	$(MAKE) -C plugins install
 	DST=../bin $(MAKE) -C libzmpeg3 install
 	$(MAKE) -C po install
diff --git a/cinelerra-5.0/cinelerra/filempeg.C b/cinelerra-5.0/cinelerra/filempeg.C
index b8e9c497..e14b657e 100644
--- a/cinelerra-5.0/cinelerra/filempeg.C
+++ b/cinelerra-5.0/cinelerra/filempeg.C
@@ -50,8 +50,8 @@
 #include <unistd.h>
 
 
-#define HVPEG_EXE "/hveg2enc.plugin"
-#define MJPEG_EXE "/mpeg2enc.plugin"
+#define HVPEG_EXE "/hveg2enc"
+#define MJPEG_EXE "/mpeg2enc"
 
 
 // M JPEG dependancies
@@ -484,10 +484,9 @@ int FileMPEG::open_file(int rd, int wr)
 // Construct command line
 			if(!result)
 			{
-				char string[BCTEXTLEN];  string[0] = 0;
-				sprintf(mjpeg_command, "%s%s", 
-					file->preferences->plugin_dir, HVPEG_EXE);
-				append_vcommand_line(string);
+				char string[BCTEXTLEN];
+				get_exe_path(string);
+				sprintf(mjpeg_command, "%s/%s", string, HVPEG_EXE);
 
 				if(asset->aspect_ratio > 0)
 				{
@@ -535,8 +534,9 @@ int FileMPEG::open_file(int rd, int wr)
 // mjpegtools encoder
 //  this one is cinelerra-x.x.x/thirdparty/mjpegtools/mpeg2enc
 		{
-			sprintf(mjpeg_command, "%s%s -v 0 ", 
-				file->preferences->plugin_dir, MJPEG_EXE);
+			char string[BCTEXTLEN];
+			get_exe_path(string);
+			sprintf(mjpeg_command, "%s/%s -v 0 ", string, MJPEG_EXE);
 
 // Must disable interlacing if MPEG-1
 			switch (asset->vmpeg_preset)
@@ -550,7 +550,6 @@ int FileMPEG::open_file(int rd, int wr)
 
 // The current usage of mpeg2enc requires bitrate of 0 when quantization is fixed and
 // quantization of 1 when bitrate is fixed.  Perfectly intuitive.
-			char string[BCTEXTLEN];
 			if(asset->vmpeg_fix_bitrate)
 			{
 				sprintf(string, " -b %d -q 1", asset->vmpeg_bitrate / 1000);
diff --git a/cinelerra-5.0/cinelerra/pluginserver.C b/cinelerra-5.0/cinelerra/pluginserver.C
index 6602f1eb..25573cf4 100644
--- a/cinelerra-5.0/cinelerra/pluginserver.C
+++ b/cinelerra-5.0/cinelerra/pluginserver.C
@@ -314,16 +314,11 @@ int PluginServer::open_plugin(int master,
 	this->plugin = plugin;
 	this->edl = edl;
 	if( plugin_type != PLUGIN_TYPE_FFMPEG && plugin_type != PLUGIN_TYPE_EXECUTABLE && !load_obj() ) {
-// If the load failed it may still be an executable tool for a specific
-// file format, in which case we just store the path.
-		set_title(path);
-		char string[BCTEXTLEN];
-		strcpy(string, load_error());
-		if( !strstr(string, "executable") ) {
-			eprintf("PluginServer::open_plugin: load_obj %s = %s\n", path, string);
-			return PLUGINSERVER_NOT_RECOGNIZED;
-		}
-		plugin_type = PLUGIN_TYPE_EXECUTABLE;
+// If the load failed, can't use error to detect executable
+//  because locale and language selection change the load_error()
+//	if( !strstr(string, "executable") ) { set_title(path); plugin_type = PLUGIN_TYPE_EXECUTABLE; }
+		eprintf("PluginServer::open_plugin: load_obj %s = %s\n", path, load_error());
+		return PLUGINSERVER_NOT_RECOGNIZED;
 	}
 	if( plugin_type == PLUGIN_TYPE_UNKNOWN || plugin_type == PLUGIN_TYPE_BUILTIN ) {
 		new_plugin =
diff --git a/cinelerra-5.0/plugins/Makefile b/cinelerra-5.0/plugins/Makefile
index 19064e0a..e45c30b5 100644
--- a/cinelerra-5.0/plugins/Makefile
+++ b/cinelerra-5.0/plugins/Makefile
@@ -138,21 +138,13 @@ DIRS = \
 #	findobject \
 
 DATA = $(PLUGIN_DIR)/fonts $(PLUGIN_DIR)/shapes
-MPEG2ENC = $(PLUGIN_DIR)/mpeg2enc.plugin
-HVEG2ENC = $(PLUGIN_DIR)/hveg2enc.plugin
 LADSPA = $(BINDIR)/ladspa
 
-all:	$(DIRS) $(DATA) $(MPEG2ENC) $(HVEG2ENC) $(LADSPA)
+all:	$(DIRS) $(DATA) $(LADSPA)
 
 $(DATA):
 	cp -a $(notdir $@) $(PLUGIN_DIR)/.
 
-$(MPEG2ENC):
-	cp -a ../thirdparty/mjpegtools*/mpeg2enc/mpeg2enc $@
-
-$(HVEG2ENC):
-	cp -a ../mpeg2enc/$(OBJDIR)/hveg2enc $@
-
 $(LADSPA):
 	mkdir -p $@
 	if [ -d $(THIRDPARTY)/ladspa-*/usr/local/lib/ladspa ]; then \