summaryrefslogtreecommitdiff
path: root/vdr.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2017-11-09 16:23:15 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2017-11-09 16:23:15 +0100
commit950b248220c64aea4078ce0461647d020db4c44f (patch)
tree9f742e801a412862c2dd622741a8f881fa43f8f0 /vdr.c
parentbc3b6ed601f37fa6b2cfb7dec9e39439590be6b3 (diff)
downloadvdr-950b248220c64aea4078ce0461647d020db4c44f.tar.gz
vdr-950b248220c64aea4078ce0461647d020db4c44f.tar.bz2
Switching the primary device is no longer done via osSwitchDvb, but rather by the main program loop reacting to changes in Setup.PrimaryDVB
Diffstat (limited to 'vdr.c')
-rw-r--r--vdr.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/vdr.c b/vdr.c
index 41673660..78afa872 100644
--- a/vdr.c
+++ b/vdr.c
@@ -22,7 +22,7 @@
*
* The project's page is at http://www.tvdr.de
*
- * $Id: vdr.c 4.20 2017/11/02 14:59:50 kls Exp $
+ * $Id: vdr.c 4.21 2017/11/09 16:15:34 kls Exp $
*/
#include <getopt.h>
@@ -732,6 +732,7 @@ int main(int argc, char *argv[])
bool InhibitEpgScan = false;
bool IsInfoMenu = false;
cSkin *CurrentSkin = NULL;
+ int OldPrimaryDVB = 0;
// Load plugins:
@@ -834,6 +835,7 @@ int main(int argc, char *argv[])
}
}
}
+ OldPrimaryDVB = Setup.PrimaryDVB;
// Check for timers in automatic start time window:
@@ -1426,12 +1428,6 @@ int main(int argc, char *argv[])
DELETE_MENU;
cControl::Shutdown();
break;
- case osSwitchDvb:
- DELETE_MENU;
- cControl::Shutdown();
- Skins.QueueMessage(mtInfo, tr("Switching primary DVB..."));
- cDevice::SetPrimaryDevice(Setup.PrimaryDVB);
- break;
case osPlugin: DELETE_MENU;
Menu = cMenuMain::PluginOsdObject();
if (Menu)
@@ -1507,6 +1503,17 @@ int main(int argc, char *argv[])
}
}
+ // Change primary device:
+ int NewPrimaryDVB = Setup.PrimaryDVB;
+ if (NewPrimaryDVB != OldPrimaryDVB) {
+ DELETE_MENU;
+ cControl::Shutdown();
+ Skins.QueueMessage(mtInfo, tr("Switching primary DVB..."));
+ cOsdProvider::Shutdown();
+ cDevice::SetPrimaryDevice(NewPrimaryDVB);
+ OldPrimaryDVB = NewPrimaryDVB;
+ }
+
// SIGHUP shall cause a restart:
if (LastSignal == SIGHUP) {
if (ShutdownHandler.ConfirmRestart(true) && Interface->Confirm(tr("Press any key to cancel restart"), RESTARTCANCELPROMPT, true))