From 5db5327ab2126b7bf1a1eb20530de5cb288f9c52 Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 25 Jun 2009 22:13:52 +0200 Subject: scan.cpp: sync audio/video detection with current pmt.cpp code --- lib/dvb/scan.cpp | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) (limited to 'lib') diff --git a/lib/dvb/scan.cpp b/lib/dvb/scan.cpp index 0948c503..1c8e4d2e 100644 --- a/lib/dvb/scan.cpp +++ b/lib/dvb/scan.cpp @@ -281,6 +281,7 @@ void eDVBScan::PMTready(int err) bool have_video = false; unsigned short pcrpid = 0xFFFF; std::vector::const_iterator i; + for (i = m_PMT->getSections().begin(); i != m_PMT->getSections().end(); ++i) { const ProgramMapSection &pmt = **i; @@ -294,50 +295,68 @@ void eDVBScan::PMTready(int err) int isaudio = 0, isvideo = 0, is_scrambled = 0; switch ((*es)->getType()) { + case 0xEA: // TS_PSI_ST_SMPTE_VC1 case 0x1b: // AVC Video Stream (MPEG4 H264) + case 0x10: // MPEG 4 Part 2 case 0x01: // MPEG 1 video case 0x02: // MPEG 2 video isvideo = 1; //break; fall through !!! case 0x03: // MPEG 1 audio - case 0x04: // MPEG 2 audio: + case 0x04: // MPEG 2 audio + case 0x0f: // MPEG 2 AAC + case 0x11: // MPEG 4 AAC if (!isvideo) isaudio = 1; - //break; fall through !!! case 0x06: // PES Private case 0x81: // user private - /* PES private can contain AC-3, DTS or lots of other stuff. - check descriptors to get the exact type. */ for (DescriptorConstIterator desc = (*es)->getDescriptors()->begin(); desc != (*es)->getDescriptors()->end(); ++desc) { uint8_t tag = (*desc)->getTag(); if (!isaudio && !isvideo) { + /* PES private can contain AC-3, DTS or lots of other stuff. + check descriptors to get the exakt type. */ switch (tag) { - case DTS_DESCRIPTOR: + case 0x1C: // TS_PSI_DT_MPEG4_Audio + case 0x2B: // TS_PSI_DT_MPEG2_AAC case AAC_DESCRIPTOR: case AC3_DESCRIPTOR: + case DTS_DESCRIPTOR: + case AUDIO_STREAM_DESCRIPTOR: isaudio = 1; break; + case 0x28: // TS_PSI_DT_AVC + case 0x1B: // TS_PSI_DT_MPEG4_Video + case VIDEO_STREAM_DESCRIPTOR: + isvideo = 1; + break; case REGISTRATION_DESCRIPTOR: /* some services don't have a separate AC3 descriptor */ { - /* libdvbsi++ doesn't yet support this descriptor type, so work around. */ - if ((*desc)->getLength() != 4) + /* libdvbsi++ doesn't yet support this descriptor type, so work around. */ + if ((*desc)->getLength() < 4) break; unsigned char descr[6]; (*desc)->writeToBuffer(descr); int format_identifier = (descr[2] << 24) | (descr[3] << 16) | (descr[4] << 8) | (descr[5]); switch (format_identifier) { - case 0x41432d33: + case 0x41432d33: // == 'AC-3' + case 0x44545331 ... 0x44545333: // DTS1/DTS2/DTS3 + case 0x42535344: // == 'BSSD' (LPCM) isaudio = 1; + break; + case 0x56432d31: // == 'VC-1' + isvideo = 1; + break; default: break; } - break; } + default: + break; } } if (tag == CA_DESCRIPTOR) -- cgit v1.2.3 From e761d85be96d37eabe9571cac9c2b54e81de1baf Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 25 Jun 2009 22:15:12 +0200 Subject: ChannelSelection.py: add dvb service type 22 as tv service, add dvb service type 10 as radio service --- lib/python/Screens/ChannelSelection.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py index 0ff4042b..5d78ec77 100644 --- a/lib/python/Screens/ChannelSelection.py +++ b/lib/python/Screens/ChannelSelection.py @@ -653,9 +653,18 @@ class ChannelSelectionEdit: MODE_TV = 0 MODE_RADIO = 1 -# this makes it much simple to implement a selectable radio or tv mode :) -service_types_tv = '1:7:1:0:0:0:0:0:0:0:(type == 1) || (type == 17) || (type == 195) || (type == 25) || (type == 134)' -service_types_radio = '1:7:2:0:0:0:0:0:0:0:(type == 2)' +# type 1 = digital television service +# type 4 = nvod reference service (NYI) +# type 17 = MPEG-2 HD digital television service +# type 22 = advanced codec SD digital television +# type 24 = advanced codec SD NVOD reference service (NYI) +# type 25 = advanced codec HD digital television +# type 27 = advanced codec HD NVOD reference service (NYI) +# type 2 = digital radio sound service +# type 10 = advanced codec digital radio sound service + +service_types_tv = '1:7:1:0:0:0:0:0:0:0:(type == 1) || (type == 17) || (type == 22) || (type == 25) || (type == 134) || (type == 195)' +service_types_radio = '1:7:2:0:0:0:0:0:0:0:(type == 2) || (type == 10)' class ChannelSelectionBase(Screen): def __init__(self, session): -- cgit v1.2.3 From b1e8243644459d097aacaa79fc92c746da9d4fea Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 25 Jun 2009 23:24:33 +0200 Subject: db.cpp: compare complete provider and service name --- lib/dvb/db.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/dvb/db.cpp b/lib/dvb/db.cpp index cabc56d9..ffc62f6c 100644 --- a/lib/dvb/db.cpp +++ b/lib/dvb/db.cpp @@ -172,10 +172,10 @@ int eDVBService::checkFilter(const eServiceReferenceDVB &ref, const eDVBChannelQ switch (query.m_type) { case eDVBChannelQuery::tName: - res = m_service_name_sort.find(query.m_string) != std::string::npos; + res = m_service_name_sort == query.m_string; break; case eDVBChannelQuery::tProvider: - res = m_provider_name.find(query.m_string) != std::string::npos; + res = m_provider_name == query.m_string; break; case eDVBChannelQuery::tType: res = ref.getServiceType() == query.m_int; -- cgit v1.2.3