diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2017-11-09 16:23:15 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2017-11-09 16:23:15 +0100 |
commit | 950b248220c64aea4078ce0461647d020db4c44f (patch) | |
tree | 9f742e801a412862c2dd622741a8f881fa43f8f0 /vdr.c | |
parent | bc3b6ed601f37fa6b2cfb7dec9e39439590be6b3 (diff) | |
download | vdr-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.c | 21 |
1 files changed, 14 insertions, 7 deletions
@@ -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)) |