summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--device.c26
-rw-r--r--device.h3
-rw-r--r--xineliboutput.c5
3 files changed, 23 insertions, 11 deletions
diff --git a/device.c b/device.c
index 8229f73d..ba797bf4 100644
--- a/device.c
+++ b/device.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: device.c,v 1.119 2012-03-13 12:53:41 phintuka Exp $
+ * $Id: device.c,v 1.120 2012-03-17 20:14:41 phintuka Exp $
*
*/
@@ -200,13 +200,8 @@ cXinelibDevice::cXinelibDevice()
m_OriginalPrimaryDevice = 0;
m_ForcePrimaryDeviceCnt = 0;
- if(*xc.local_frontend && strncmp(xc.local_frontend, "none", 4))
- m_clients.Add(m_local = new cXinelibLocal(xc.local_frontend));
- if(xc.remote_mode && xc.listen_port>0)
- m_clients.Add(m_server = new cXinelibServer(xc.listen_port));
-
memset(m_MetaInfo, 0, sizeof(m_MetaInfo));
-
+
m_PlayMode = pmNone;
m_AudioChannel = 0;
@@ -242,6 +237,23 @@ cXinelibDevice::~cXinelibDevice()
ts_state_dispose(m_tssVideoSize);
}
+bool cXinelibDevice::InitDevice()
+{
+ TRACEF("cXinelibDevice::InitDevice");
+
+ if (m_local || m_server) {
+ LOGMSG("cXinelibDevice::InitDevice() called twice");
+ return false;
+ }
+
+ if (*xc.local_frontend && strncmp(xc.local_frontend, "none", 4))
+ m_clients.Add(m_local = new cXinelibLocal(xc.local_frontend));
+ if (xc.remote_mode && xc.listen_port > 0)
+ m_clients.Add(m_server = new cXinelibServer(xc.listen_port));
+
+ return true;
+}
+
bool cXinelibDevice::StartDevice()
{
TRACEF("cXinelibDevice::StartDevice");
diff --git a/device.h b/device.h
index 67697c20..18ae4736 100644
--- a/device.h
+++ b/device.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: device.h,v 1.62 2012-03-13 12:53:41 phintuka Exp $
+ * $Id: device.h,v 1.63 2012-03-17 20:14:41 phintuka Exp $
*
*/
@@ -59,6 +59,7 @@ class cXinelibDevice : public cDevice
// device start/stop (from cPlugin)
public:
+ bool InitDevice(void);
bool StartDevice(void);
void StopDevice(void);
diff --git a/xineliboutput.c b/xineliboutput.c
index ed0d38a9..aca27cf0 100644
--- a/xineliboutput.c
+++ b/xineliboutput.c
@@ -21,7 +21,7 @@
*
* xineliboutput.c: VDR Plugin interface
*
- * $Id: xineliboutput.c,v 1.49 2012-03-13 13:05:14 phintuka Exp $
+ * $Id: xineliboutput.c,v 1.50 2012-03-17 20:14:41 phintuka Exp $
*
*/
@@ -168,8 +168,7 @@ bool cPluginXinelibOutput::Initialize(void)
// Initialize any background activities the plugin shall perform.
TRACEF("cPluginXinelibOutput::Initialize");
- cXinelibDevice::Instance();
- return true;
+ return cXinelibDevice::Instance().InitDevice();
}
bool cPluginXinelibOutput::Start(void)