Author: tack
Date: Tue Nov 28 16:54:34 2006
New Revision: 2101

Modified:
   trunk/popcorn/src/backends/xine/child.py
   trunk/popcorn/src/generic.py

Log:
If audio cannot be opened in xine backend, fallback to dummy ao driver;
remove STATE_OPEN from required states in seek() so that the call gets
deferred until the movie begins playing; do not just execute the first
pending command if it matches our current state but rather execute all
pending commands for the new state.


Modified: trunk/popcorn/src/backends/xine/child.py
==============================================================================
--- trunk/popcorn/src/backends/xine/child.py    (original)
+++ trunk/popcorn/src/backends/xine/child.py    Tue Nov 28 16:54:34 2006
@@ -254,7 +254,14 @@
         """
         Configure audio output.
         """
-        self._ao = self._xine.open_audio_driver(driver=driver)
+        try:
+            self._ao = self._xine.open_audio_driver(driver=driver)
+        except xine.XineError:
+            # Audio driver initialization failed; initialize a dummy driver
+            # instead.
+            self._ao = self._xine.open_audio_driver("none")
+            return
+
         if driver == 'alsa':
             set = self._xine.set_config_value
             dev = self.config.audio.device

Modified: trunk/popcorn/src/generic.py
==============================================================================
--- trunk/popcorn/src/generic.py        (original)
+++ trunk/popcorn/src/generic.py        Tue Nov 28 16:54:34 2006
@@ -203,8 +203,12 @@
         if self._blocked or kaa.notifier.shutting_down:
             return
         self._blocked = True
-        while self._pending and self.get_state() in self._pending[0][0]:
-            self._pending.pop(0)[1]()
+        # Iterate through all pending commands and execute the ones that can
+        # be called in our new state.
+        for states, callback in self._pending:
+            if self.get_state() in states:
+                callback()
+                self._pending.remove((states, callback))
         self._blocked = False
 
 
@@ -313,14 +317,11 @@
             self._player.resume()
 
 
-    @required_states(STATE_OPEN, STATE_PLAYING, STATE_PAUSED)
+    @required_states(STATE_PLAYING, STATE_PAUSED)
     def seek(self, value, type=SEEK_RELATIVE):
         """
         Seek. Possible types are SEEK_RELATIVE, SEEK_ABSOLUTE and 
SEEK_PERCENTAGE.
         """
-        if self.get_state() == STATE_OPEN:
-            # FIXME: make it possible to seek between open() and play()
-            return False
         self._player.seek(value, type)
 
 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to