diff options
author | Frank Schmirler <vdr@schmirler.de> | 2010-12-02 09:39:01 +0100 |
---|---|---|
committer | Mikko Matilainen <mikkom@iki.fi> | 2011-03-24 19:20:05 +0200 |
commit | 635ccc479f3e0d62b3f52cb5407d06185e402f5b (patch) | |
tree | 8f56fa909f40656a130f41e3cab4898093fdb0e5 /server/livestreamer.c | |
parent | db3274c046f4e2d44cb8263428073b6a43dca2fa (diff) | |
download | vdr-plugin-streamdev-635ccc479f3e0d62b3f52cb5407d06185e402f5b.tar.gz vdr-plugin-streamdev-635ccc479f3e0d62b3f52cb5407d06185e402f5b.tar.bz2 |
Snapshot 2010-09-15
Diffstat (limited to 'server/livestreamer.c')
-rw-r--r-- | server/livestreamer.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/server/livestreamer.c b/server/livestreamer.c index ff4f708..7ec7d9e 100644 --- a/server/livestreamer.c +++ b/server/livestreamer.c @@ -297,7 +297,7 @@ void cStreamdevPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, i if (written != TS_SIZE) siBuffer.ReportOverflow(TS_SIZE - written); if (pmtPid != prevPmtPid) { - m_Streamer->SetPids(pmtPid); + m_Streamer->SetPid(pmtPid, true); Add(pmtPid, 0x02); pmtVersion = -1; } @@ -442,21 +442,28 @@ bool cStreamdevLiveStreamer::SetPids(int Pid, const int *Pids1, const int *Pids2 return true; } +void cStreamdevLiveStreamer::SetPriority(int Priority) +{ + m_Priority = Priority; + StartReceiver(); +} + void cStreamdevLiveStreamer::StartReceiver(void) { - DELETENULL(m_Receiver); - if (m_NumPids > 0) { + if (m_Device != NULL && m_NumPids > 0 && IsRunning()) { Dprintf("Creating Receiver to respect changed pids\n"); + cReceiver *current = m_Receiver; #if VDRVERSNUM < 10500 m_Receiver = new cStreamdevLiveReceiver(this, m_Channel->Ca(), m_Priority, m_Pids); #else m_Receiver = new cStreamdevLiveReceiver(this, m_Channel->GetChannelID(), m_Priority, m_Pids); #endif - if (IsRunning() && m_Device != NULL) { - Dprintf("Attaching new receiver\n"); - Attach(); - } + cThreadLock ThreadLock(m_Device); + Attach(); + delete current; } + else + DELETENULL(m_Receiver); } bool cStreamdevLiveStreamer::SetChannel(const cChannel *Channel, eStreamType StreamType, const int* Apid, const int *Dpid) |