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();
}
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;

View File

@ -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