From b8f01e6db0e0955f0949f7500c58b07d294e7f92 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 1 Jul 2021 14:30:58 +0200 Subject: [PATCH] src/zapit/src/scansdt.cpp try to fix radio service type --- src/zapit/src/scansdt.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/zapit/src/scansdt.cpp b/src/zapit/src/scansdt.cpp index 4efb46a09..6b8b4f20a 100644 --- a/src/zapit/src/scansdt.cpp +++ b/src/zapit/src/scansdt.cpp @@ -356,9 +356,6 @@ uint8_t CSdt::FixServiceType(uint8_t type) (type == 0x82) || (type == 0x87) || (type == 0xd3)) return ST_DIGITAL_TELEVISION_SERVICE; - if(type == 0x0A) - return ST_DIGITAL_RADIO_SOUND_SERVICE; - return type; } @@ -368,14 +365,22 @@ bool CSdt::ParseServiceDescriptor(ServiceDescription * service, ServiceDescripto if(SID) printf("=================== PAT: sid %04x ===================\n",SID); #endif - uint8_t service_type = SID ? 1 : FixServiceType(sd->getServiceType()); - uint8_t real_type = SID ? 1 : sd->getServiceType(); + uint8_t service_type_tmp = ST_DIGITAL_TELEVISION_SERVICE; + if(sd){ + service_type_tmp = sd->getServiceType(); + if(service_type_tmp == ST_DIGITAL_RADIO_SOUND_SERVICE || service_type_tmp == 0x0A){ + service_type_tmp = ST_DIGITAL_RADIO_SOUND_SERVICE;//change real radio type to 2 + } + } + + uint8_t service_type = FixServiceType(service_type_tmp); + uint8_t real_type = service_type_tmp; t_service_id service_id = SID ? SID : service->getServiceId(); bool free_ca = SID ? 1 : service->getFreeCaMode(); int tsidonid = (transport_stream_id << 16) | original_network_id; - std::string providerName = SID ? "" : stringDVBUTF8(sd->getServiceProviderName(), 0, tsidonid); - std::string serviceName = SID ? "" : stringDVBUTF8(sd->getServiceName(), 0, tsidonid); + std::string providerName = (SID && !sd) ? "" : stringDVBUTF8(sd->getServiceProviderName(), 0, tsidonid); + std::string serviceName = (SID && !sd) ? "" : stringDVBUTF8(sd->getServiceName(), 0, tsidonid); #ifdef DEBUG_SDT_SERVICE printf("[SDT] sid %04x type %x provider [%s] service [%s] scrambled %d\n", service_id, sd->getServiceType(),