From d5a38b3213e138b6e74d724198619ab5138242ff Mon Sep 17 00:00:00 2001 From: schmirl Date: Tue, 24 Apr 2007 10:43:40 +0000 Subject: client_device-vdr-1.5.1-fixes.patch by Petri Hintukainen (#219) - VDR 1.5.0 calls some device members in different order and streamdev can't currently handle this. - do not trust in OpenDvr/CloseDvr, instead keep count of active PIDs, open data connection when it is needed and close it only when there are no active PIDs (closing data connection unsubscribes all pids at server end) - some sanity checks on server side Modified Files: client/device.c client/device.h server/connectionVTP.c --- server/connectionVTP.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'server') diff --git a/server/connectionVTP.c b/server/connectionVTP.c index 514c5a0..4776bd5 100644 --- a/server/connectionVTP.c +++ b/server/connectionVTP.c @@ -1,5 +1,5 @@ /* - * $Id: connectionVTP.c,v 1.9 2007/04/16 11:01:02 schmirl Exp $ + * $Id: connectionVTP.c,v 1.10 2007/04/24 10:43:40 schmirl Exp $ */ #include "server/connectionVTP.h" @@ -632,6 +632,10 @@ bool cConnectionVTP::CmdPORT(char *Opts) isyslog("Streamdev: Setting data connection to %s:%d", dataip, dataport); + if(m_LiveSocket && m_LiveStreamer) + m_LiveStreamer->Stop(); + delete m_LiveSocket; + m_LiveSocket = new cTBSocket(SOCK_STREAM); if (!m_LiveSocket->Connect(dataip, dataport)) { esyslog("ERROR: Streamdev: Couldn't open data connection to %s:%d: %s", @@ -640,10 +644,10 @@ bool cConnectionVTP::CmdPORT(char *Opts) return Respond(551, "Couldn't open data connection"); } - if (id == siLive) + if (m_LiveStreamer) m_LiveStreamer->Start(m_LiveSocket); - return Respond(220, "Port command ok, data connection opened"); + return Respond(220, "Port command ok, data connection opened"); } bool cConnectionVTP::CmdTUNE(char *Opts) @@ -664,6 +668,8 @@ bool cConnectionVTP::CmdTUNE(char *Opts) m_LiveStreamer = new cStreamdevLiveStreamer(1); m_LiveStreamer->SetChannel(chan, m_NoTSPIDS ? stTS : stTSPIDS); m_LiveStreamer->SetDevice(dev); + if(m_LiveSocket) + m_LiveStreamer->Start(m_LiveSocket); return Respond(220, "Channel tuned"); } -- cgit v1.2.3