diff --git a/src/daemonc/remotecontrol.cpp b/src/daemonc/remotecontrol.cpp index 6e01e2ccc..f30196d0f 100644 --- a/src/daemonc/remotecontrol.cpp +++ b/src/daemonc/remotecontrol.cpp @@ -44,6 +44,13 @@ #include "libdvbsub/dvbsub.h" #include "libtuxtxt/teletext.h" +#include +#include + +extern tallchans allchans; +extern CBouquetManager *g_bouquetManager; +extern CZapitChannel *g_current_channel; + extern uint32_t scrambled_timer; extern t_channel_id live_channel_id; //zapit @@ -60,6 +67,7 @@ CSubService::CSubService(const t_original_network_id anoriginal_network_id, cons startzeit = 0; dauer = 0; subservice_name = asubservice_name; + satellitePosition = g_current_channel ? g_current_channel->getSatellitePosition() : 0; } CSubService::CSubService(const t_original_network_id anoriginal_network_id, const t_service_id aservice_id, const t_transport_stream_id atransport_stream_id, const time_t astartzeit, const unsigned adauer) @@ -70,11 +78,13 @@ CSubService::CSubService(const t_original_network_id anoriginal_network_id, cons startzeit = astartzeit; dauer = adauer; subservice_name = ""; + satellitePosition = g_current_channel ? g_current_channel->getSatellitePosition() : 0; } t_channel_id CSubService::getChannelID(void) const { - return CREATE_CHANNEL_ID_FROM_SERVICE_ORIGINALNETWORK_TRANSPORTSTREAM_ID(service.service_id, service.original_network_id, service.transport_stream_id); + return ((uint64_t) ( satellitePosition > 0 ? satellitePosition : (uint64_t)(0xF000+ abs(satellitePosition))) << 48) | + (uint64_t) CREATE_CHANNEL_ID_FROM_SERVICE_ORIGINALNETWORK_TRANSPORTSTREAM_ID(service.service_id, service.original_network_id, service.transport_stream_id); } @@ -97,10 +107,6 @@ CRemoteControl::CRemoteControl() is_video_started = true; } -#include -#include -extern tallchans allchans; -extern CBouquetManager *g_bouquetManager; int CRemoteControl::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data) { @@ -358,7 +364,7 @@ void CRemoteControl::getSubChannels() linkedServices[i].serviceId, linkedServices[i].transportStreamId, linkedServices[i].name)); - if (subChannels[i].getChannelID() == (current_channel_id&0xFFFFFFFFFFFFULL)) + if ((subChannels[i].getChannelID()&0xFFFFFFFFFFFFULL) == (current_channel_id&0xFFFFFFFFFFFFULL)) selected_subchannel = i; } copySubChannelsToZapit(); diff --git a/src/daemonc/remotecontrol.h b/src/daemonc/remotecontrol.h index 62ec5a668..6b70de6d5 100644 --- a/src/daemonc/remotecontrol.h +++ b/src/daemonc/remotecontrol.h @@ -53,6 +53,7 @@ class CSubService { private: struct CZapitClient::commandAddSubServices service; + t_satellite_position satellitePosition; public: time_t startzeit; @@ -62,7 +63,7 @@ class CSubService CSubService(const t_original_network_id, const t_service_id, const t_transport_stream_id, const std::string &asubservice_name); CSubService(const t_original_network_id, const t_service_id, const t_transport_stream_id, const time_t astartzeit, const unsigned adauer); - t_channel_id getChannelID (void) const; + t_channel_id getChannelID (void) const; inline const struct CZapitClient::commandAddSubServices getAsZapitSubService(void) const { return service; } }; diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 8e49d954c..e76360cb6 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -566,7 +566,7 @@ int zapit(const t_channel_id channel_id, bool in_nvod, bool forupdate = 0, bool live_channel_id = g_current_channel->getChannelID(); saveZapitSettings(false, false); - printf("[zapit] zap to %s(%llx)\n", g_current_channel->getName().c_str(), live_channel_id); + printf("[zapit] zap to %s (%llx)\n", g_current_channel->getName().c_str(), live_channel_id); if(!tune_to_channel(newchannel, transponder_change)) return -1; @@ -1595,17 +1595,22 @@ printf("[zapit] recording mode: %d\n", msgSetRecordMode.activate);fflush(stdout) while (CBasicServer::receive_data(connfd, &msgAddSubService, sizeof(msgAddSubService))) { t_original_network_id original_network_id = msgAddSubService.original_network_id; t_service_id service_id = msgAddSubService.service_id; -DBG("NVOD insert %llx\n", CREATE_CHANNEL_ID_FROM_SERVICE_ORIGINALNETWORK_TRANSPORTSTREAM_ID(msgAddSubService.service_id, msgAddSubService.original_network_id, msgAddSubService.transport_stream_id)); + + t_satellite_position satellitePosition = g_current_channel ? g_current_channel->getSatellitePosition() : 0; + t_channel_id sub_channel_id = + ((uint64_t) ( satellitePosition > 0 ? satellitePosition : (uint64_t)(0xF000+ abs(satellitePosition))) << 48) | + (uint64_t) CREATE_CHANNEL_ID_FROM_SERVICE_ORIGINALNETWORK_TRANSPORTSTREAM_ID(msgAddSubService.service_id, msgAddSubService.original_network_id, msgAddSubService.transport_stream_id); + DBG("NVOD insert %llx\n", sub_channel_id); nvodchannels.insert ( std::pair ( - CREATE_CHANNEL_ID_FROM_SERVICE_ORIGINALNETWORK_TRANSPORTSTREAM_ID(msgAddSubService.service_id, msgAddSubService.original_network_id, msgAddSubService.transport_stream_id), + sub_channel_id, CZapitChannel ( "NVOD", service_id, msgAddSubService.transport_stream_id, original_network_id, 1, - g_current_channel ? g_current_channel->getSatellitePosition() : 0, + satellitePosition, 0 ) )