Implemented VDR 2.1.4 cStatus::ChannelChange(...)

This commit is contained in:
Frank Schmirler 2014-08-09 23:04:45 +02:00
parent 83262870d5
commit bdee8c1923
2 changed files with 21 additions and 1 deletions

View File

@ -670,6 +670,19 @@ bool cStreamdevLiveStreamer::ProvidesChannel(const cChannel *Channel, int Priori
return device;
}
void cStreamdevLiveStreamer::ChannelChange(const cChannel *Channel)
{
if (Running() && m_Device && m_Device->ProvidesTransponder(Channel) && ISTRANSPONDER(m_Channel->Transponder(), Channel->Transponder())) {
Detach();
if (m_Device->SwitchChannel(m_Channel, false)) {
Attach();
dsyslog("streamdev: channel %d (%s) changed", Channel->Number(), Channel->Name());
}
else
isyslog("streamdev: failed to re-tune after channel %d (%s) changed", Channel->Number(), Channel->Name());
}
}
void cStreamdevLiveStreamer::MainThreadHook()
{
if (!m_SwitchLive && Running() && m_Device && !m_Device->IsTunedToTransponder(m_Channel) && !IsReceiving()) {

View File

@ -2,6 +2,7 @@
#define VDR_STREAMDEV_LIVESTREAMER_H
#include <vdr/config.h>
#include <vdr/status.h>
#include <vdr/receiver.h>
#include "server/streamer.h"
@ -18,7 +19,11 @@ class cStreamdevLiveReceiver;
// --- cStreamdevLiveStreamer -------------------------------------------------
class cStreamdevLiveStreamer: public cStreamdevStreamer, public cMainThreadHookSubscriber {
class cStreamdevLiveStreamer: public cStreamdevStreamer, public cMainThreadHookSubscriber
#if VDRVERSNUM >= 20104
, public cStatus
#endif
{
private:
int m_Priority;
int m_Pids[MAXRECEIVEPIDS + 1];
@ -51,6 +56,8 @@ protected:
virtual int Put(const uchar *Data, int Count);
virtual void Action(void);
virtual void ChannelChange(const cChannel *Channel);
public:
cStreamdevLiveStreamer(const cServerConnection *Connection, const cChannel *Channel, int Priority, eStreamType StreamType, const int* Apid = NULL, const int* Dpid = NULL);
virtual ~cStreamdevLiveStreamer();