Author: dmeyer
Date: Sun Apr 29 20:16:19 2007
New Revision: 2666

Modified:
   trunk/popcorn/src/backends/base.py
   trunk/popcorn/src/backends/xine/child.py
   trunk/popcorn/src/backends/xine/player.py
   trunk/popcorn/test/play.py

Log:
move aspect-pixel calc to base, fix aspect hack in xine

Modified: trunk/popcorn/src/backends/base.py
==============================================================================
--- trunk/popcorn/src/backends/base.py  (original)
+++ trunk/popcorn/src/backends/base.py  Sun Apr 29 20:16:19 2007
@@ -173,6 +173,14 @@
         return aspect, size
 
 
+    def _get_pixel_aspect(self):
+        """
+        Get pixel aspect ratio based on monitoraspect and window size
+        """
+        a, fs = self._get_aspect()
+        return (float(a[0])/a[1]) / (float(fs[0])/fs[1])
+
+
     def __repr__(self):
         """
         For debugging only.

Modified: trunk/popcorn/src/backends/xine/child.py
==============================================================================
--- trunk/popcorn/src/backends/xine/child.py    (original)
+++ trunk/popcorn/src/backends/xine/child.py    Sun Apr 29 20:16:19 2007
@@ -163,13 +163,13 @@
                 # it. This is a bug somehow and it happens. So we return the 
cached
                 # values and reset self._vo_settings[0] so we recalculate when
                 # the aspect changes the next time.
-                self._vo_settings[0] = False
+                self._vo_settings = False, (width, height, aspect)
                 return self._vo_settings_calculated
             if self._vo_settings[1] == (width, height, aspect):
                 # use cache when nothing has changed
                 return self._vo_settings_calculated
 
-        self._vo_settings = [ True, (width, height, aspect) ]
+        self._vo_settings = True, (width, height, aspect)
 
         vid_w, vid_h, vid_a = width, height, aspect
 
@@ -296,10 +296,7 @@
             self._vo_visible = False
 
         if aspect:
-            # aspect is (aspect_w, aspect_h), (screen_w, screen_h)
-            aspect, fs = aspect
-            a = (float(aspect[0])/aspect[1]) / (float(fs[0])/fs[1])
-            self._stream_settings['pixel-aspect'] = a
+            self._stream_settings['pixel-aspect'] = aspect
         
         # FIXME: this should work but it crashes with an exception that
         # video.device.xv_colorkey is not defined.

Modified: trunk/popcorn/src/backends/xine/player.py
==============================================================================
--- trunk/popcorn/src/backends/xine/player.py   (original)
+++ trunk/popcorn/src/backends/xine/player.py   Sun Apr 29 20:16:19 2007
@@ -230,7 +230,8 @@
                 elif self._xine_configured:
                     # No previous window, must reconfigure vo.
                     self._xine.configure_video(window.get_id(), 
window.get_size(),
-                                               self._get_aspect(), 
config.video.colorkey)
+                                               self._get_pixel_aspect(),
+                                               config.video.colorkey)
 
         # Sends a window_changed command to slave.
         if window and self._xine:
@@ -245,7 +246,7 @@
         self._xine.set_config(config)
         if self._window:
             self._xine.configure_video(self._window.get_id(), 
self._window.get_size(),
-                                       self._get_aspect(), 
config.video.colorkey)
+                                       self._get_pixel_aspect(), 
config.video.colorkey)
         else:
             self._xine.configure_video(None, None, None, None)
         self._xine.configure_audio(config.audio.driver)

Modified: trunk/popcorn/test/play.py
==============================================================================
--- trunk/popcorn/test/play.py  (original)
+++ trunk/popcorn/test/play.py  Sun Apr 29 20:16:19 2007
@@ -72,7 +72,7 @@
     player.set_property('zoom', player.get_property('zoom') - 10)
 
 kaa.notifier.Timer(print_pos).start(0.1)
-# kaa.notifier.OneShotTimer(do_something1).start(2)
+kaa.notifier.OneShotTimer(do_something1).start(2)
 # kaa.notifier.OneShotTimer(do_something2).start(4)
 # kaa.notifier.Timer(do_zoom).start(2)
 kaa.main()

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to