In cStreamdevStreamer dropped Activate(bool) and moved its code into Start()

This commit is contained in:
Frank Schmirler 2012-12-04 17:21:36 +01:00
parent eaf9321c4c
commit 0677f48329
5 changed files with 9 additions and 22 deletions

View File

@ -1,6 +1,7 @@
VDR Plugin 'streamdev' Revision History VDR Plugin 'streamdev' Revision History
--------------------------------------- ---------------------------------------
- In cStreamdevStreamer dropped Activate(bool) and moved its code into Start().
- Moved cStreamdevFilterStreamer to livefilter.[hc] - Moved cStreamdevFilterStreamer to livefilter.[hc]
- Return HTTP/1.1 compliant response headers plus some always useful headers - Return HTTP/1.1 compliant response headers plus some always useful headers
- Return HTTP URL parameters ending with ".dlna.org" as response headers - Return HTTP URL parameters ending with ".dlna.org" as response headers

View File

@ -1012,7 +1012,6 @@ bool cConnectionVTP::CmdPORT(char *Opts)
if(!m_FilterStreamer) if(!m_FilterStreamer)
m_FilterStreamer = new cStreamdevFilterStreamer; m_FilterStreamer = new cStreamdevFilterStreamer;
m_FilterStreamer->Start(m_FilterSocket); m_FilterStreamer->Start(m_FilterSocket);
m_FilterStreamer->Activate(true);
return Respond(220, "Port command ok, data connection opened"); return Respond(220, "Port command ok, data connection opened");
break; break;

View File

@ -24,7 +24,6 @@ private:
cStreamdevStreamer *m_Streamer; cStreamdevStreamer *m_Streamer;
protected: protected:
virtual void Activate(bool On);
virtual void Receive(uchar *Data, int Length); virtual void Receive(uchar *Data, int Length);
public: public:
@ -54,12 +53,6 @@ void cStreamdevLiveReceiver::Receive(uchar *Data, int Length) {
m_Streamer->ReportOverflow(Length - p); m_Streamer->ReportOverflow(Length - p);
} }
inline void cStreamdevLiveReceiver::Activate(bool On)
{
Dprintf("LiveReceiver->Activate(%d)\n", On);
m_Streamer->Activate(On);
}
// --- cStreamdevPatFilter ---------------------------------------------------- // --- cStreamdevPatFilter ----------------------------------------------------
class cStreamdevPatFilter : public cFilter { class cStreamdevPatFilter : public cFilter {

View File

@ -126,30 +126,25 @@ cStreamdevStreamer::~cStreamdevStreamer()
void cStreamdevStreamer::Start(cTBSocket *Socket) void cStreamdevStreamer::Start(cTBSocket *Socket)
{ {
Dprintf("start streamer\n"); Dprintf("start writer\n");
m_Writer = new cStreamdevWriter(Socket, this); m_Writer = new cStreamdevWriter(Socket, this);
m_Writer->Start(); m_Writer->Start();
Attach(); if (!Active()) {
} Dprintf("start streamer\n");
void cStreamdevStreamer::Activate(bool On)
{
if (On && !Active()) {
Dprintf("activate streamer\n");
cThread::Start(); cThread::Start();
} }
Attach();
} }
void cStreamdevStreamer::Stop(void) void cStreamdevStreamer::Stop(void)
{ {
Detach();
if (Running()) { if (Running()) {
Dprintf("stopping streamer\n"); Dprintf("stop streamer\n");
Cancel(3); Cancel(3);
} }
if (m_Writer) { Dprintf("stop writer\n");
Detach(); DELETENULL(m_Writer);
DELETENULL(m_Writer);
}
} }
void cStreamdevStreamer::Action(void) void cStreamdevStreamer::Action(void)

View File

@ -85,7 +85,6 @@ public:
virtual void Stop(void); virtual void Stop(void);
bool Abort(void); bool Abort(void);
void Activate(bool On);
int Receive(uchar *Data, int Length) { return m_RingBuffer->PutTS(Data, Length); } int Receive(uchar *Data, int Length) { return m_RingBuffer->PutTS(Data, Length); }
void ReportOverflow(int Bytes) { m_RingBuffer->ReportOverflow(Bytes); } void ReportOverflow(int Bytes) { m_RingBuffer->ReportOverflow(Bytes); }