mirror of
https://projects.vdr-developer.org/git/vdr-plugin-streamdev.git
synced 2023-10-10 19:16:51 +02:00
Make sure that a FilterStreamer is only started if client supports it
(#261) Modified Files: client/socket.c server/connectionVTP.c server/connectionVTP.h
This commit is contained in:
parent
650b4d5443
commit
21da96308d
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: socket.c,v 1.8 2007/04/24 10:57:34 schmirl Exp $
|
* $Id: socket.c,v 1.9 2008/03/13 16:01:17 schmirl Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <tools/select.h>
|
#include <tools/select.h>
|
||||||
@ -140,8 +140,14 @@ bool cClientSocket::CheckConnection(void) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
isyslog("Streamdev: Connected to server %s:%d using capabilities TSPIDS",
|
const char *Filters = "";
|
||||||
RemoteIp().c_str(), RemotePort());
|
#if VDRVERSNUM >= 10300
|
||||||
|
if(Command("CAPS FILTERS", 220))
|
||||||
|
Filters = ",FILTERS";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
isyslog("Streamdev: Connected to server %s:%d using capabilities TSPIDS%s",
|
||||||
|
RemoteIp().c_str(), RemotePort(), Filters);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: connectionVTP.c,v 1.16 2008/03/12 09:36:27 schmirl Exp $
|
* $Id: connectionVTP.c,v 1.17 2008/03/13 16:01:18 schmirl Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "server/connectionVTP.h"
|
#include "server/connectionVTP.h"
|
||||||
@ -478,6 +478,7 @@ cConnectionVTP::cConnectionVTP(void):
|
|||||||
m_FilterStreamer(NULL),
|
m_FilterStreamer(NULL),
|
||||||
m_LastCommand(NULL),
|
m_LastCommand(NULL),
|
||||||
m_StreamType(stTSPIDS),
|
m_StreamType(stTSPIDS),
|
||||||
|
m_FiltersSupport(false),
|
||||||
m_LSTEHandler(NULL),
|
m_LSTEHandler(NULL),
|
||||||
m_LSTCHandler(NULL),
|
m_LSTCHandler(NULL),
|
||||||
m_LSTTHandler(NULL)
|
m_LSTTHandler(NULL)
|
||||||
@ -608,8 +609,10 @@ bool cConnectionVTP::CmdCAPS(char *Opts)
|
|||||||
//
|
//
|
||||||
// Deliver section filters data in separate, channel-independent data stream
|
// Deliver section filters data in separate, channel-independent data stream
|
||||||
//
|
//
|
||||||
if (strcasecmp(Opts, "FILTERS") == 0)
|
if (strcasecmp(Opts, "FILTERS") == 0) {
|
||||||
|
m_FiltersSupport = true;
|
||||||
return Respond(220, "Capability \"%s\" accepted", Opts);
|
return Respond(220, "Capability \"%s\" accepted", Opts);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return Respond(561, "Capability \"%s\" not known", Opts);
|
return Respond(561, "Capability \"%s\" not known", Opts);
|
||||||
@ -680,6 +683,7 @@ bool cConnectionVTP::CmdPORT(char *Opts)
|
|||||||
|
|
||||||
#if VDRVERSNUM >= 10300
|
#if VDRVERSNUM >= 10300
|
||||||
if (id == siLiveFilter) {
|
if (id == siLiveFilter) {
|
||||||
|
m_FiltersSupport = true;
|
||||||
if(m_FilterStreamer)
|
if(m_FilterStreamer)
|
||||||
m_FilterStreamer->Stop();
|
m_FilterStreamer->Stop();
|
||||||
delete m_FilterSocket;
|
delete m_FilterSocket;
|
||||||
@ -743,10 +747,12 @@ bool cConnectionVTP::CmdTUNE(char *Opts)
|
|||||||
m_LiveStreamer->Start(m_LiveSocket);
|
m_LiveStreamer->Start(m_LiveSocket);
|
||||||
|
|
||||||
#if VDRVERSNUM >= 10300
|
#if VDRVERSNUM >= 10300
|
||||||
if(!m_FilterStreamer)
|
if(m_FiltersSupport) {
|
||||||
m_FilterStreamer = new cStreamdevFilterStreamer;
|
if(!m_FilterStreamer)
|
||||||
m_FilterStreamer->SetDevice(dev);
|
m_FilterStreamer = new cStreamdevFilterStreamer;
|
||||||
//m_FilterStreamer->SetChannel(chan);
|
m_FilterStreamer->SetDevice(dev);
|
||||||
|
//m_FilterStreamer->SetChannel(chan);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return Respond(220, "Channel tuned");
|
return Respond(220, "Channel tuned");
|
||||||
|
@ -24,6 +24,7 @@ private:
|
|||||||
|
|
||||||
char *m_LastCommand;
|
char *m_LastCommand;
|
||||||
eStreamType m_StreamType;
|
eStreamType m_StreamType;
|
||||||
|
bool m_FiltersSupport;
|
||||||
|
|
||||||
// Members adopted for SVDRP
|
// Members adopted for SVDRP
|
||||||
cRecordings Recordings;
|
cRecordings Recordings;
|
||||||
|
Loading…
Reference in New Issue
Block a user