driver/streamts.cpp: use record demux, deny streaming if pip running

This commit is contained in:
[CST] Focus
2013-03-25 13:36:58 +04:00
parent 305455e004
commit 698b56c6db

View File

@@ -162,8 +162,14 @@ void CStreamInstance::run()
{
printf("CStreamInstance::run: %llx\n", channel_id);
#if 0
dmx = new cDemux(STREAM_DEMUX);//FIXME
#endif
CZapitChannel * tmpchan = CServiceManager::getInstance()->FindChannel(channel_id);
if (!tmpchan)
return;
dmx = new cDemux(tmpchan->getRecordDemux());//FIXME
dmx->Open(DMX_TP_CHANNEL, NULL, DMX_BUFFER_SIZE);
/* pids here cannot be empty */
@@ -350,6 +356,13 @@ bool CStreamManager::Parse(int fd, stream_pids_t &pids, t_channel_id &chid)
printf("CStreamManager::Parse: channel %llx recorded, aborting..\n", chid);
return false;
}
#ifdef ENABLE_PIP
t_channel_id pip_channel_id = CZapit::getInstance()->GetPipChannelID();
if ((chid == pip_channel_id) && (channel->getRecordDemux() == channel->getPipDemux())) {
printf("CStreamManager::Parse: channel %llx used for pip, aborting..\n", chid);
return false;
}
#endif
#endif
printf("CStreamManager::Parse: no pids in url, using channel %llx pids\n", chid);