From 64a21d359e87a8e51dfcabfb9dda0fda1101d440 Mon Sep 17 00:00:00 2001 From: nox Date: Sat, 10 Dec 2011 17:14:43 +0000 Subject: Fix startup crash without setup.conf by merging fix from upstream. Feature safe: yes --- multimedia/vdr/Makefile | 2 +- multimedia/vdr/files/patch-initialchannel | 33 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 multimedia/vdr/files/patch-initialchannel (limited to 'multimedia/vdr') diff --git a/multimedia/vdr/Makefile b/multimedia/vdr/Makefile index eb1ad6ce1613..997e06ebb2f7 100644 --- a/multimedia/vdr/Makefile +++ b/multimedia/vdr/Makefile @@ -7,7 +7,7 @@ PORTNAME= vdr PORTVERSION= 1.7.19 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= multimedia MASTER_SITES= ftp://ftp.tvdr.de/vdr/Developer/ diff --git a/multimedia/vdr/files/patch-initialchannel b/multimedia/vdr/files/patch-initialchannel new file mode 100644 index 000000000000..cb658665a03d --- /dev/null +++ b/multimedia/vdr/files/patch-initialchannel @@ -0,0 +1,33 @@ +--- config.c.orig ++++ config.c +@@ -399,7 +399,7 @@ cSetup::cSetup(void) + CurrentChannel = -1; + CurrentVolume = MAXVOLUME; + CurrentDolby = 0; +- // InitialChannel is initialized by constructor ++ InitialChannel = ""; + InitialVolume = -1; + ChannelsWrap = 0; + EmergencyExit = 1; +--- vdr.c.orig ++++ vdr.c +@@ -735,12 +723,14 @@ int main(int argc, char *argv[]) + + if (!cDevice::WaitForAllDevicesReady(DEVICEREADYTIMEOUT)) + dsyslog("not all devices ready after %d seconds", DEVICEREADYTIMEOUT); +- if (isnumber(Setup.InitialChannel)) { // for compatibility with old setup.conf files +- if (cChannel *Channel = Channels.GetByNumber(atoi(Setup.InitialChannel))) +- Setup.InitialChannel = Channel->GetChannelID().ToString(); ++ if (*Setup.InitialChannel) { ++ if (isnumber(Setup.InitialChannel)) { // for compatibility with old setup.conf files ++ if (cChannel *Channel = Channels.GetByNumber(atoi(Setup.InitialChannel))) ++ Setup.InitialChannel = Channel->GetChannelID().ToString(); ++ } ++ if (cChannel *Channel = Channels.GetByChannelID(tChannelID::FromString(Setup.InitialChannel))) ++ Setup.CurrentChannel = Channel->Number(); + } +- if (cChannel *Channel = Channels.GetByChannelID(tChannelID::FromString(Setup.InitialChannel))) +- Setup.CurrentChannel = Channel->Number(); + if (Setup.InitialVolume >= 0) + Setup.CurrentVolume = Setup.InitialVolume; + Channels.SwitchTo(Setup.CurrentChannel); -- cgit