summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY2
-rw-r--r--menu.c5
-rw-r--r--osdbase.h3
-rw-r--r--vdr.c21
4 files changed, 18 insertions, 13 deletions
diff --git a/HISTORY b/HISTORY
index b6f87e4a..e9048065 100644
--- a/HISTORY
+++ b/HISTORY
@@ -9194,3 +9194,5 @@ Video Disk Recorder Revision History
- If an event in the Schedules menu is marked with a 'T' or 'I' and the user presses the
Red button to edit the timer, local timers are now preferred over remote timers
in case there is more than one timer that will record that event.
+- Switching the primary device is no longer done via osSwitchDvb (which has been
+ removed), but rather by the main program loop reacting to changes in Setup.PrimaryDVB.
diff --git a/menu.c b/menu.c
index a12276df..f69f25ec 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c 4.43 2017/11/02 15:26:42 kls Exp $
+ * $Id: menu.c 4.44 2017/11/09 14:56:38 kls Exp $
*/
#include "menu.h"
@@ -3587,7 +3587,6 @@ void cMenuSetupDVB::Setup(void)
eOSState cMenuSetupDVB::ProcessKey(eKeys Key)
{
- int oldPrimaryDVB = ::Setup.PrimaryDVB;
int oldVideoDisplayFormat = ::Setup.VideoDisplayFormat;
bool oldVideoFormat = ::Setup.VideoFormat;
bool newVideoFormat = data.VideoFormat;
@@ -3650,8 +3649,6 @@ eOSState cMenuSetupDVB::ProcessKey(eKeys Key)
}
}
if (state == osBack && Key == kOk) {
- if (::Setup.PrimaryDVB != oldPrimaryDVB)
- state = osSwitchDvb;
if (::Setup.VideoDisplayFormat != oldVideoDisplayFormat)
cDevice::PrimaryDevice()->SetVideoDisplayFormat(eVideoDisplayFormat(::Setup.VideoDisplayFormat));
if (::Setup.VideoFormat != oldVideoFormat)
diff --git a/osdbase.h b/osdbase.h
index 8e2a77ad..b08e8b13 100644
--- a/osdbase.h
+++ b/osdbase.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: osdbase.h 4.3 2017/11/07 15:31:24 kls Exp $
+ * $Id: osdbase.h 4.4 2017/11/09 14:57:48 kls Exp $
*/
#ifndef __OSDBASE_H
@@ -30,7 +30,6 @@ enum eOSState { osUnknown,
osStopRecord,
osStopReplay,
osCancelEdit,
- osSwitchDvb,
osBack,
osEnd,
os_User, // the following values can be used locally
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))