revert DVI workaround... because hdmi is broken when one time a dvi mode was
[enigma2.git] / lib / python / Plugins / SystemPlugins / Videomode / VideoHardware.py
index d20bc630979ce42c2f19ca74c6daf1a9983dba6d..43543bb1bd4d5bd1ea82ba293c39da3f579aa924 100644 (file)
@@ -46,12 +46,13 @@ class VideoHardware:
                "1366x768" : { 60: "1366x768"},
                "1366x768 multi" : { 50: "1366x768", 60: "1366x768_50"},
                "1280x768": { 60: "1280x768"},
-               "640x480" : { 60: "640x480"} 
+               "640x480" : { 60: "640x480"}
        }
 
        modes["Scart"] = ["PAL", "NTSC", "Multi"]
        modes["YPbPr"] = ["720p", "1080i"]
        modes["DVI"] = ["720p", "1080i", "PC"]
+       modes["DVI-PC"] = ["PC"]
 
        widescreen_modes = set(["720p", "1080i"])
 
@@ -59,6 +60,8 @@ class VideoHardware:
                self.last_modes_preferred =  [ ]
                self.on_hotplug = CList()
                self.standby = False
+               self.current_mode = None
+               self.current_port = None
 
                self.readAvailableModes()
 
@@ -133,6 +136,7 @@ class VideoHardware:
                print "setMode - port:", port, "mode:", mode, "rate:", rate
                # we can ignore "port"
                self.current_mode = mode
+               self.current_port = port
                modes = self.rates[mode][rate]
 
                mode_50 = modes.get(50)
@@ -161,8 +165,11 @@ class VideoHardware:
 
        def saveMode(self, port, mode, rate):
                config.av.videoport.value = port
+               config.av.videoport.save()
                config.av.videomode[port].value = mode
+               config.av.videomode[port].save()
                config.av.videorate[mode].value = rate
+               config.av.videorate[mode].save()
 
        def isPortAvailable(self, port):
                # fixme
@@ -307,7 +314,7 @@ class VideoHardware:
                        else:
                                fb = "low"
                else:
-                       if config.av.videoport.value == "Scart" and config.av.colorformat.value == "rgb":
+                       if self.current_port == "Scart" and config.av.colorformat.value == "rgb":
                                fb = "high"
                        else:
                                fb = "low"