mirror of
https://projects.vdr-developer.org/git/vdr-plugin-streamdev.git
synced 2023-10-10 19:16:51 +02: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:
parent
9e46f86686
commit
90ae937018
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 translation (thanks to micky979)
|
||||
- updated Italian translation (thanks to Diego Pierotto)
|
||||
- removed some unused translations
|
||||
|
@ -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.5.2.1 2008/04/29 07:01:00 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.3.2.1 2008/04/29 07:01:00 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.7 2008/04/07 14:27:27 schmirl Exp $
|
||||
* $Id: streamdev-server.c,v 1.7.2.1 2008/04/29 07:00:57 schmirl Exp $
|
||||
*/
|
||||
|
||||
#include <getopt.h>
|
||||
@ -26,6 +26,7 @@ cPluginStreamdevServer::cPluginStreamdevServer(void)
|
||||
|
||||
cPluginStreamdevServer::~cPluginStreamdevServer()
|
||||
{
|
||||
free(opt_remux);
|
||||
}
|
||||
|
||||
const char *cPluginStreamdevServer::Description(void)
|
||||
@ -51,7 +52,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;
|
||||
@ -77,6 +80,8 @@ bool cPluginStreamdevServer::Start(void)
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (!opt_remux)
|
||||
opt_remux = strdup(DEFAULT_EXTERNREMUX);
|
||||
|
||||
cStreamdevServer::Initialize();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user