op_tvout: never use zero width/height
authorGrazvydas Ignotas <notasas@gmail.com>
Thu, 30 Aug 2012 23:48:25 +0000 (02:48 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Thu, 30 Aug 2012 23:48:25 +0000 (02:48 +0300)
recipes/pandora-system/pandora-scripts.bb
recipes/pandora-system/pandora-scripts/TVoutConfig.py
recipes/pandora-system/pandora-scripts/op_tvout.sh

index 4802b2c..45f78a7 100644 (file)
@@ -6,7 +6,7 @@ COMPATIBLE_MACHINE = "omap3-pandora"
 DEPENDS = "zenity dbus"
 RDEPENDS = "zenity dbus"
 
-PR = "r112"
+PR = "r113"
 
 SRC_URI = " \
           file://op_paths.sh \
index 518356c..afeb723 100755 (executable)
@@ -226,6 +226,17 @@ class TVoutModel(ConfigModel):
         settings['width'], settings['height'] = settings.pop('size').split(',')
         settings['x'], settings['y'] = settings.pop('position').split(',')
 
+        # The system may have 0,0 w,h; use last_written or defaults if it does
+        for key in 'width', 'height':
+            if settings[key] == '0':
+                settings[key] = (self.last_written[key] if self.last_written[key] != '0'
+                                 else DC_DISABLED_DICT[key])
+
+        # 0,0 pos is more likely to be intended, but still fallback to last_written
+        for key in 'x', 'y':
+            if settings[key] == '0':
+                settings[key] = self.last_written[key]
+
         # To determine the layer we interpret the framebuffer values
         fb0 = settings.pop('fb0')
         fb1 = settings.pop('fb1')
index 65a6556..b10f748 100755 (executable)
@@ -96,7 +96,11 @@ while true; do
       ;;
     "-ps")
       shift
-      pal_size=$1
+      if [ "$1" != "0,0" ]; then
+        pal_size=$1
+      else
+        echo "warning: ignored pal_size: $1"
+      fi
       ;;
     "-pp")
       shift
@@ -104,7 +108,11 @@ while true; do
       ;;
     "-ns")
       shift
-      ntsc_size=$1
+      if [ "$1" != "0,0" ]; then
+        ntsc_size=$1
+      else
+        echo "warning: ignored ntsc_size: $1"
+      fi
       ;;
     "-np")
       shift