From 98aac75ff9d3a4bcc51e6908d77bdcc7d3665d7e Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 13 Jan 2012 15:59:49 +0400 Subject: [PATCH] capmt: remember source demux for updates; use record demux from channel Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/109d74c24b0eb8c6786b31000e90ded765fc8435 Author: [CST] Focus Date: 2012-01-13 (Fri, 13 Jan 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/zapit/include/zapit/cam.h | 2 ++ src/zapit/src/cam.cpp | 14 +++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/zapit/include/zapit/cam.h b/src/zapit/include/zapit/cam.h index 3d8c8b735..ebfcf5d7c 100644 --- a/src/zapit/include/zapit/cam.h +++ b/src/zapit/include/zapit/cam.h @@ -46,6 +46,7 @@ class CCam : public CBasicClient virtual unsigned char getVersion(void) const; virtual const char *getSocketName(void) const; int camask, demuxes[3]; + int source_demux; public: CCam(); @@ -53,6 +54,7 @@ class CCam : public CBasicClient bool setCaPmt(CCaPmt * const caPmt, int _demux = 0, int _camask = 1, bool update = false); int getCaMask(void) { return camask; }; int makeMask(int demux, bool add); + int getSource() { return source_demux; }; }; typedef std::map cammap_t; diff --git a/src/zapit/src/cam.cpp b/src/zapit/src/cam.cpp index 99b42ee28..d66212b3b 100644 --- a/src/zapit/src/cam.cpp +++ b/src/zapit/src/cam.cpp @@ -33,6 +33,7 @@ CCam::CCam() { camask = 0; demuxes[0] = demuxes[1] = demuxes[2] = 0; + source_demux = -1; } unsigned char CCam::getVersion(void) const @@ -72,6 +73,7 @@ bool CCam::sendMessage(const char * const data, const size_t length, bool update bool CCam::setCaPmt(CCaPmt * const caPmt, int _demux, int _camask, bool update) { camask = _camask; + source_demux = _demux; printf("CCam::setCaPmt cam %x source %d camask %d update %s\n", (int) this, _demux, camask, update ? "yes" : "no" ); if(camask == 0) { @@ -140,7 +142,7 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start printf("CCamManager: channel %llx not found\n", channel_id); return false; } - +printf("CCam::SetMode: channel %llx [%s] mode %d %s update %d\n", channel_id, channel->getName().c_str(), mode, start ? "START" : "STOP", force_update); mutex.lock(); if(channel->getCaPmt() == NULL) { printf("CCamManager: channel %llx dont have caPmt\n", channel_id); @@ -148,8 +150,6 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start return false; } - sat_iterator_t sit = satellitePositions.find(channel->getSatellitePosition()); - cammap_iterator_t it = channel_map.find(channel_id); if(it != channel_map.end()) { cam = it->second; @@ -167,8 +167,8 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start demux = LIVE_DEMUX; break; case RECORD: - source = DEMUX_SOURCE_0; - demux = RECORD_DEMUX;//FIXME + source = channel->getRecordDemux(); //DEMUX_SOURCE_0;//FIXME + demux = channel->getRecordDemux(); //RECORD_DEMUX;//FIXME break; case STREAM: source = DEMUX_SOURCE_0; @@ -182,6 +182,10 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start else newmask = cam->makeMask(demux, start); + if(cam->getSource() > 0) + source = cam->getSource(); + +printf("CCam::SetMode: source %d old mask %d new mask %d force update %s\n", source, oldmask, newmask, force_update ? "yes" : "no"); if((oldmask != newmask) || force_update) cam->setCaPmt(channel->getCaPmt(), source, newmask, true);