avswitch: reset video mode only when it has changed
authorFelix Domke <tmbinc@elitedvb.net>
Thu, 16 Feb 2006 11:19:06 +0000 (11:19 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Thu, 16 Feb 2006 11:19:06 +0000 (11:19 +0000)
lib/driver/avswitch.cpp
lib/driver/avswitch.h

index 35df938..8197acc 100644 (file)
@@ -14,6 +14,7 @@ eAVSwitch::eAVSwitch()
 {
        ASSERT(!instance);
        instance = this;
 {
        ASSERT(!instance);
        instance = this;
+       m_video_mode = 0;
 }
 
 eAVSwitch::~eAVSwitch()
 }
 
 eAVSwitch::~eAVSwitch()
@@ -132,6 +133,10 @@ void eAVSwitch::setVideomode(int mode)
 {
        char *pal="pal";
        char *ntsc="ntsc";
 {
        char *pal="pal";
        char *ntsc="ntsc";
+       
+       if (mode == m_video_mode)
+               return;
+       
        int fd;
 
        if((fd = open("/proc/stb/video/videomode", O_WRONLY)) < 0) {
        int fd;
 
        if((fd = open("/proc/stb/video/videomode", O_WRONLY)) < 0) {
index 9c26b1a..d0221d5 100644 (file)
@@ -4,11 +4,12 @@
 class eAVSwitch
 {
        static eAVSwitch *instance;
 class eAVSwitch
 {
        static eAVSwitch *instance;
+       int m_video_mode;
 #ifdef SWIG
        eAVSwitch();
        ~eAVSwitch();
 #endif
 #ifdef SWIG
        eAVSwitch();
        ~eAVSwitch();
 #endif
-protected:     
+protected:
 public:
 #ifndef SWIG
        eAVSwitch();
 public:
 #ifndef SWIG
        eAVSwitch();