mirror of
				https://projects.vdr-developer.org/git/vdr-plugin-streamdev.git
				synced 2023-10-10 17:16:51 +00:00 
			
		
		
		
	- Fixed assignment of externremux.sh's default location
cPlugin::ConfigDirectory() cannot be used directly after the plugin has been loaded. The return value of AddDirectory() must be allocated.
This commit is contained in:
		
							
								
								
									
										1
									
								
								HISTORY
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								HISTORY
									
									
									
									
									
								
							| @@ -1,6 +1,7 @@ | ||||
| VDR Plugin 'streamdev' Revision History | ||||
| --------------------------------------- | ||||
|  | ||||
| - fixed assignment of externremux.sh's default location (reported by plautze) | ||||
| - added french translations (thanks to micky979) | ||||
| - added italian translations (thanks to Diego Pierotto) | ||||
| - added gettext support (thanks to Rolf Ahrenberg) | ||||
|   | ||||
| @@ -7,8 +7,6 @@ | ||||
| #include <signal.h> | ||||
| #include <unistd.h> | ||||
|  | ||||
| const char *g_ExternRemux = EXTERNREMUXPATH; | ||||
|  | ||||
| class cTSExt: public cThread { | ||||
| private: | ||||
| 	cRingBufferLinear *m_ResultBuffer; | ||||
| @@ -68,7 +66,7 @@ cTSExt::cTSExt(cRingBufferLinear *ResultBuffer, std::string Parameter): | ||||
| 		for (int i = STDERR_FILENO + 1; i < MaxPossibleFileDescriptors; i++) | ||||
| 			close(i); //close all dup'ed filedescriptors | ||||
|  | ||||
| 		std::string cmd = std::string(g_ExternRemux) + " " + Parameter; | ||||
| 		std::string cmd = std::string(opt_remux) + " " + Parameter; | ||||
| 		execl("/bin/sh", "sh", "-c", cmd.c_str(), NULL); | ||||
| 		_exit(-1); | ||||
| 	} | ||||
|   | ||||
| @@ -5,8 +5,6 @@ | ||||
| #include <vdr/ringbuffer.h> | ||||
| #include <string> | ||||
|  | ||||
| extern const char *g_ExternRemux; | ||||
|  | ||||
| class cTSExt; | ||||
|  | ||||
| class cExternRemux: public cTSRemux { | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /* | ||||
|  *  $Id: server.c,v 1.5 2007/04/02 10:32:34 schmirl Exp $ | ||||
|  *  $Id: server.c,v 1.6 2008/04/29 07:00:54 schmirl Exp $ | ||||
|  */ | ||||
|  | ||||
| #include "server/server.h" | ||||
| @@ -13,6 +13,7 @@ | ||||
| #include <errno.h> | ||||
|  | ||||
| cSVDRPhosts StreamdevHosts; | ||||
| char *opt_remux = NULL; | ||||
|  | ||||
| cStreamdevServer         *cStreamdevServer::m_Instance = NULL; | ||||
| cList<cServerComponent>   cStreamdevServer::m_Servers; | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /* | ||||
|  *  $Id: server.h,v 1.3 2008/04/07 14:50:33 schmirl Exp $ | ||||
|  *  $Id: server.h,v 1.4 2008/04/29 07:00:54 schmirl Exp $ | ||||
|  */ | ||||
|   | ||||
| #ifndef VDR_STREAMDEV_SERVER_H | ||||
| @@ -10,9 +10,11 @@ | ||||
| #include "server/component.h" | ||||
| #include "server/connection.h" | ||||
|  | ||||
| #define EXTERNREMUXPATH (*AddDirectory(cPlugin::ConfigDirectory(PLUGIN_NAME_I18N), "externremux.sh")) | ||||
| #define DEFAULT_EXTERNREMUX (*AddDirectory(cPlugin::ConfigDirectory(PLUGIN_NAME_I18N), "externremux.sh")) | ||||
| #define STREAMDEVHOSTSPATH (*AddDirectory(cPlugin::ConfigDirectory(PLUGIN_NAME_I18N), "streamdevhosts.conf")) | ||||
|  | ||||
| extern char *opt_remux; | ||||
|  | ||||
| class cStreamdevServer: public cThread { | ||||
| private: | ||||
| 	bool m_Active; | ||||
|   | ||||
| @@ -3,7 +3,7 @@ | ||||
|  * | ||||
|  * See the README file for copyright information and how to reach the author. | ||||
|  * | ||||
|  * $Id: streamdev-server.c,v 1.8 2008/04/08 14:18:15 schmirl Exp $ | ||||
|  * $Id: streamdev-server.c,v 1.9 2008/04/29 07:00:53 schmirl Exp $ | ||||
|  */ | ||||
|  | ||||
| #include <getopt.h> | ||||
| @@ -25,6 +25,7 @@ cPluginStreamdevServer::cPluginStreamdevServer(void) | ||||
|  | ||||
| cPluginStreamdevServer::~cPluginStreamdevServer()  | ||||
| { | ||||
| 	free(opt_remux); | ||||
| } | ||||
|  | ||||
| const char *cPluginStreamdevServer::Description(void)  | ||||
| @@ -50,7 +51,9 @@ bool cPluginStreamdevServer::ProcessArgs(int argc, char *argv[]) | ||||
| 	while((c = getopt_long(argc, argv, "r:", long_options, NULL)) != -1) { | ||||
| 		switch (c) { | ||||
| 			case 'r': | ||||
| 				g_ExternRemux = optarg; | ||||
| 				if (opt_remux) | ||||
| 				    free(opt_remux); | ||||
| 				opt_remux = strdup(optarg); | ||||
| 				break; | ||||
| 			default: | ||||
| 				return false; | ||||
| @@ -74,6 +77,8 @@ bool cPluginStreamdevServer::Start(void) | ||||
| 		} | ||||
| 		return false; | ||||
| 	} | ||||
| 	if (!opt_remux) | ||||
| 		opt_remux = strdup(DEFAULT_EXTERNREMUX); | ||||
|  | ||||
| 	cStreamdevServer::Initialize(); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user