streamts: improve channel switching logic

Origin commit data
------------------
Commit: 145a1c0938
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2014-01-12 (Sun, 12 Jan 2014)
This commit is contained in:
Stefan Seyfried
2014-01-12 23:32:42 +01:00
parent 27925c4fae
commit cdebcaf67e

View File

@@ -357,7 +357,12 @@ bool CStreamManager::Parse(int fd, stream_pids_t &pids, t_channel_id &chid)
printf("############################# channel_id %" PRIx64 "\n", tmpid);
CZapitChannel * tmpchan = CServiceManager::getInstance()->FindChannel(tmpid);
if (tmpchan && (tmpid != chid) && SAME_TRANSPONDER(tmpid, chid)) {
/* we may switch channels if neutrino is in standby and we are not recording
* the current channel TODO: check interaction with recording */
bool may_switch =
(CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_standby) &&
!CRecordManager::getInstance()->RecordingStatus(chid);
if (tmpchan && (tmpid != chid) && (may_switch || SAME_TRANSPONDER(tmpid, chid))) {
printf("############################# channel_id %" PRIx64 " -> zap\n", tmpid);
bool ret = g_Zapit->zapTo_record(tmpid) > 0;
if (ret) {