From bbfab943a6da7ad90b090a622c2beb90870293ca Mon Sep 17 00:00:00 2001 From: mglae Date: Fri, 9 Nov 2018 19:13:36 +0100 Subject: [PATCH] vdr-plugin-wirbelscan: fix segv, interface channel counts and device detection --- .../vdr-plugin-wirbelscan-001-fix_segv.patch | 12 +++++++++ ...-plugin-wirbelscan-002-channel_count.patch | 22 +++++++++++++++ .../vdr-plugin-wirbelscan-003-detect.patch | 27 +++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 packages/addons/addon-depends/vdr-plugins/vdr-plugin-wirbelscan/patches/vdr-plugin-wirbelscan-001-fix_segv.patch create mode 100644 packages/addons/addon-depends/vdr-plugins/vdr-plugin-wirbelscan/patches/vdr-plugin-wirbelscan-002-channel_count.patch create mode 100644 packages/addons/addon-depends/vdr-plugins/vdr-plugin-wirbelscan/patches/vdr-plugin-wirbelscan-003-detect.patch diff --git a/packages/addons/addon-depends/vdr-plugins/vdr-plugin-wirbelscan/patches/vdr-plugin-wirbelscan-001-fix_segv.patch b/packages/addons/addon-depends/vdr-plugins/vdr-plugin-wirbelscan/patches/vdr-plugin-wirbelscan-001-fix_segv.patch new file mode 100644 index 0000000000..e2532d3b00 --- /dev/null +++ b/packages/addons/addon-depends/vdr-plugins/vdr-plugin-wirbelscan/patches/vdr-plugin-wirbelscan-001-fix_segv.patch @@ -0,0 +1,12 @@ +--- a/statemachine.c ++++ b/statemachine.c +@@ -309,7 +309,8 @@ void cStateMachine::Action(void) { + else + newState = eAddChannels; + if (time(0) != tm) { +- MenuScanning->SetProgress(lProgress); ++ if (MenuScanning) ++ MenuScanning->SetProgress(lProgress); + tm = time(0); + } + } diff --git a/packages/addons/addon-depends/vdr-plugins/vdr-plugin-wirbelscan/patches/vdr-plugin-wirbelscan-002-channel_count.patch b/packages/addons/addon-depends/vdr-plugins/vdr-plugin-wirbelscan/patches/vdr-plugin-wirbelscan-002-channel_count.patch new file mode 100644 index 0000000000..319dfb710f --- /dev/null +++ b/packages/addons/addon-depends/vdr-plugins/vdr-plugin-wirbelscan/patches/vdr-plugin-wirbelscan-002-channel_count.patch @@ -0,0 +1,22 @@ +--- a/wirbelscan.c ++++ b/wirbelscan.c +@@ -13,6 +13,8 @@ + #include "countries.h" + #include "satellites.h" + ++extern TChannels NewChannels; ++ + static const char *VERSION = "2017.06.04"; + static const char *DESCRIPTION = "DVB channel scan for VDR"; + static const char *MAINMENUENTRY = NULL; /* main menu -> use wirbelscancontrol plugin */ +@@ -201,8 +203,8 @@ bool cPluginWirbelscan::Service(const ch + strcpy(s->transponder, lTransponder.length()? lTransponder.c_str():"none"); + s->progress = s->status == StatusScanning?lProgress:0; + s->strength = s->status == StatusScanning?lStrength:0; +- s->numChannels = 0; // Channels.Count(); // not possible any longer. +- s->newChannels = channelcount; // ((Channels.Count() - channelcount) > 0) && channelcount?Channels.Count() - channelcount:0; ++ s->numChannels = cChannels::MaxNumber(); ++ s->newChannels = (NewChannels.Count() > cChannels::MaxNumber()) ? NewChannels.Count() - cChannels::MaxNumber():0; + s->nextTransponders = nextTransponders; + return true; + } diff --git a/packages/addons/addon-depends/vdr-plugins/vdr-plugin-wirbelscan/patches/vdr-plugin-wirbelscan-003-detect.patch b/packages/addons/addon-depends/vdr-plugins/vdr-plugin-wirbelscan/patches/vdr-plugin-wirbelscan-003-detect.patch new file mode 100644 index 0000000000..9a68e30651 --- /dev/null +++ b/packages/addons/addon-depends/vdr-plugins/vdr-plugin-wirbelscan/patches/vdr-plugin-wirbelscan-003-detect.patch @@ -0,0 +1,27 @@ +--- a/common.c ++++ b/common.c +@@ -46,20 +46,10 @@ void cMySetup::InitSystems(void) { + for(int i = 0; i < cDevice::NumDevices(); i++) { + cDevice* device = cDevice::GetDevice(i); + if (device == NULL) continue; +- std::string t = *device->DeviceType(); +- if (t == "DVB-C" ) systems[SCAN_CABLE ] = 1; +- if (t == "DVB-T" ) systems[SCAN_TERRESTRIAL ] = 1; +- if (t == "DSS" ) systems[SCAN_SATELLITE ] = 1; +- if (t == "DVB-S" ) systems[SCAN_SATELLITE ] = 1; +- if (t == "DVB-S2") systems[SCAN_SATELLITE ] = 1; +- if (t == "ATSC" ) systems[SCAN_TERRCABLE_ATSC] = 1; +- if (t == "DVB-T2") systems[SCAN_TERRESTRIAL ] = 1; +- if (t == "TURBO" ) systems[SCAN_SATELLITE ] = 1; +- if (t == "SAT>IP") { +- if (device->ProvidesSource(cSource::FromString("S"))) systems[SCAN_SATELLITE ] = 1; +- if (device->ProvidesSource(cSource::FromString("T"))) systems[SCAN_TERRESTRIAL ] = 1; +- if (device->ProvidesSource(cSource::FromString("C"))) systems[SCAN_CABLE ] = 1; +- } ++ if (device->ProvidesSource(cSource::stSat)) systems[SCAN_SATELLITE] = 1; ++ if (device->ProvidesSource(cSource::stTerr)) systems[SCAN_TERRESTRIAL] = 1; ++ if (device->ProvidesSource(cSource::stCable)) systems[SCAN_CABLE] = 1; ++ if (device->ProvidesSource(cSource::stAtsc)) systems[SCAN_TERRCABLE_ATSC] = 1; + } + + if (DVB_Type >= SCAN_NO_DEVICE || ! systems[DVB_Type]) {