diff --git a/server/livestreamer.c b/server/livestreamer.c index dcd9e7d..c939e1e 100644 --- a/server/livestreamer.c +++ b/server/livestreamer.c @@ -472,9 +472,9 @@ bool cStreamdevLiveStreamer::IsReceiving(void) const return m_Receiver && m_Receiver->IsAttached(); } -void cStreamdevLiveStreamer::StartReceiver(void) +void cStreamdevLiveStreamer::StartReceiver(bool Force) { - if (m_NumPids > 0) { + if (m_NumPids > 0 || Force) { Dprintf("Creating Receiver to respect changed pids\n"); cReceiver *current = m_Receiver; cThreadLock ThreadLock(m_Device); @@ -536,6 +536,8 @@ bool cStreamdevLiveStreamer::SetChannel(const int* Apid, const int *Dpid) case stTSPIDS: Dprintf("pid streaming mode\n"); + // No PIDs requested yet. Start receiver anyway to occupy device + StartReceiver(true); return true; default: return false; diff --git a/server/livestreamer.h b/server/livestreamer.h index e259ee9..29217d9 100644 --- a/server/livestreamer.h +++ b/server/livestreamer.h @@ -32,7 +32,7 @@ private: Streamdev::cTSRemux *m_Remux; bool m_SwitchLive; - void StartReceiver(void); + void StartReceiver(bool Force = false); bool HasPid(int Pid); /* Test if device is in use as the transfer mode receiver device