add ability to select in scan what is todo with existing services (Clear before scan)
[enigma2.git] / lib / driver / avswitch.cpp
index 35df9388a2b3e765382b2ae65cd4fca844c4bb1e..f9144f24c42c487a25ed06d66316eafa47bb6179 100644 (file)
@@ -14,6 +14,7 @@ eAVSwitch::eAVSwitch()
 {
        ASSERT(!instance);
        instance = this;
+       m_video_mode = 0;
 }
 
 eAVSwitch::~eAVSwitch()
@@ -104,10 +105,12 @@ void eAVSwitch::setAspectRatio(int ratio)
        1-4:3 PanScan
        2-16:9
        3-16:9 forced
+       4-16:9 Letterbox
+       5-16:9 PanScan
        */
        
-       char *aspect[] = {"4:3", "4:3", "any", "16:9"};
-       char *policy[] = {"letterbox", "panscan", "bestfit", "panscan"};
+       char *aspect[] = {"4:3", "4:3", "any", "16:9", "16:10", "16:10"};
+       char *policy[] = {"letterbox", "panscan", "bestfit", "panscan", "letterbox", "panscan"};
 
        int fd;
        if((fd = open("/proc/stb/video/aspect", O_WRONLY)) < 0) {
@@ -132,6 +135,10 @@ void eAVSwitch::setVideomode(int mode)
 {
        char *pal="pal";
        char *ntsc="ntsc";
+       
+       if (mode == m_video_mode)
+               return;
+       
        int fd;
 
        if((fd = open("/proc/stb/video/videomode", O_WRONLY)) < 0) {
@@ -147,6 +154,8 @@ void eAVSwitch::setVideomode(int mode)
                        break;
        }
        close(fd);
+
+       m_video_mode = mode;
 }
 
 void eAVSwitch::setWSS(int val) // 0 = auto, 1 = auto(4:3_off)