In TSPIDS mode, create and attach receiver with empty pid list to occupy device

This commit is contained in:
Frank Schmirler 2014-06-23 23:28:36 +02:00
parent 5a173b0b21
commit 1dc1423429
2 changed files with 5 additions and 3 deletions

View File

@ -472,9 +472,9 @@ bool cStreamdevLiveStreamer::IsReceiving(void) const
return m_Receiver && m_Receiver->IsAttached(); 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"); Dprintf("Creating Receiver to respect changed pids\n");
cReceiver *current = m_Receiver; cReceiver *current = m_Receiver;
cThreadLock ThreadLock(m_Device); cThreadLock ThreadLock(m_Device);
@ -536,6 +536,8 @@ bool cStreamdevLiveStreamer::SetChannel(const int* Apid, const int *Dpid)
case stTSPIDS: case stTSPIDS:
Dprintf("pid streaming mode\n"); Dprintf("pid streaming mode\n");
// No PIDs requested yet. Start receiver anyway to occupy device
StartReceiver(true);
return true; return true;
default: default:
return false; return false;

View File

@ -32,7 +32,7 @@ private:
Streamdev::cTSRemux *m_Remux; Streamdev::cTSRemux *m_Remux;
bool m_SwitchLive; bool m_SwitchLive;
void StartReceiver(void); void StartReceiver(bool Force = false);
bool HasPid(int Pid); bool HasPid(int Pid);
/* Test if device is in use as the transfer mode receiver device /* Test if device is in use as the transfer mode receiver device