From 8d7583a61eaa29cc8d8976b30420fb24211b8f73 Mon Sep 17 00:00:00 2001 From: satbaby Date: Thu, 9 Dec 2010 20:41:23 +0000 Subject: [PATCH] -fix broken sdt scan git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@940 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/zapit/src/pat.cpp | 2 +- src/zapit/src/sdt.cpp | 25 ++++++++++++++----------- src/zapit/src/zapit.cpp | 4 +++- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/zapit/src/pat.cpp b/src/zapit/src/pat.cpp index 8bcc0458e..96d92b76c 100644 --- a/src/zapit/src/pat.cpp +++ b/src/zapit/src/pat.cpp @@ -114,7 +114,7 @@ int scan_parse_pat( std::vector > &sidpmt ) } } while (filter[4]++ != buffer[7]); delete dmx; - return -1; + return 1; } static unsigned char pbuffer[PAT_SIZE]; diff --git a/src/zapit/src/sdt.cpp b/src/zapit/src/sdt.cpp index 324559d13..24aff2772 100644 --- a/src/zapit/src/sdt.cpp +++ b/src/zapit/src/sdt.cpp @@ -373,9 +373,6 @@ _repeat: int parse_current_sdt( const t_transport_stream_id p_transport_stream_id, const t_original_network_id p_original_network_id, t_satellite_position satellitePosition, freq_id_t freq) { - cDemux * dmx = new cDemux(); - dmx->Open(DMX_PSI_CHANNEL); - int ret = -1; unsigned char buffer[SDT_SIZE]; @@ -397,30 +394,36 @@ int parse_current_sdt( const t_transport_stream_id p_transport_stream_id, const int tmp_free_CA_mode = -1; unsigned char filter[DMX_FILTER_SIZE]; unsigned char mask[DMX_FILTER_SIZE]; + memset(filter, 0x00, DMX_FILTER_SIZE); + memset(mask, 0x00, DMX_FILTER_SIZE); filter[0] = 0x42; filter[1] = (p_transport_stream_id >> 8) & 0xff; filter[2] = p_transport_stream_id & 0xff; - filter[3] = 0x00; +// filter[3] = 0x00; filter[4] = 0x00; filter[5] = 0x00; filter[6] = (p_original_network_id >> 8) & 0xff; filter[7] = p_original_network_id & 0xff; - memset(&filter[8], 0x00, 8); + //memset(&filter[8], 0x00, 8); mask[0] = 0xFF; mask[1] = 0xFF; mask[2] = 0xFF; - mask[3] = 0x00; +// mask[3] = 0x00; mask[4] = 0xFF; - mask[5] = 0x00; + mask[5] = 0xFF; mask[6] = 0xFF; mask[7] = 0xFF; - memset(&mask[8], 0x00, 8); +// memset(&mask[8], 0x00, 8); std::vector > sidpmt; - scan_parse_pat( sidpmt ); - + int pat_ok = scan_parse_pat( sidpmt ); + + cDemux * dmx = new cDemux(); + dmx->Open(DMX_PSI_CHANNEL); + int ret = -1; + do { if ((dmx->sectionFilter(0x11, filter, mask, 8) < 0) || (dmx->Read(buffer, SDT_SIZE) < 0)) { delete dmx; @@ -438,7 +441,7 @@ int parse_current_sdt( const t_transport_stream_id p_transport_stream_id, const EIT_schedule_flag = buffer[pos + 2] & 0x02; EIT_present_following_flag = buffer[pos + 2] & 0x01; running_status = buffer [pos + 3] & 0xE0; - for (unsigned short i=0; i