Author: duncan
Date: Sat Jun  9 07:59:59 2007
New Revision: 9676

Modified:
   branches/rel-1/freevo/src/video/plugins/xine.py

Log:
[ 1729024 ] bookmarks for xine
Third patch from Christian Lyra applied


Modified: branches/rel-1/freevo/src/video/plugins/xine.py
==============================================================================
--- branches/rel-1/freevo/src/video/plugins/xine.py     (original)
+++ branches/rel-1/freevo/src/video/plugins/xine.py     Sat Jun  9 07:59:59 2007
@@ -191,7 +191,7 @@
         return None
 
 
-    def stop(self):
+    def stop(self, event=None):
         '''
         Stop xine
         '''
@@ -199,19 +199,21 @@
         if not self.app:
             return
 
-        command = "%s -S get_time --stdctl --no-splash --hide-gui " % 
config.CONF.xine
-        handle = subprocess.Popen(command, shell=True, stdin=subprocess.PIPE, 
stdout=subprocess.PIPE )
-        (cin, cout) = (handle.stdin, handle.stdout)
-        try:
-            position = cout.read();
-            _debug_("Elapsed = %s" % position)
-            if position:
-                self.item.elapsed = int(position)
-        finally:
-            #xine should exit nicely, but if the first xine is already closed 
this xine will hang
-            exit_code = handle.poll()
-            if not exit_code:
-                cin.write('quit\n')
+        # if the file ends do nothing, else get elapsed time
+        if event in (STOP, USER_END):
+            command = "%s -S get_time --stdctl --no-splash --hide-gui " % 
config.CONF.xine
+            handle = subprocess.Popen(command, shell=True, 
stdin=subprocess.PIPE, stdout=subprocess.PIPE )
+            (cin, cout) = (handle.stdin, handle.stdout)
+            try:
+                position = cout.read();
+                _debug_("Elapsed = %s" % position)
+                if position:
+                    self.item.elapsed = int(position)
+            finally:
+                #xine should exit nicely, but if the first xine is already 
closed this xine will hang
+                exit_code = handle.poll()
+                if not exit_code:
+                    cin.write('quit\n')
 
         self.app.stop('quit\n')
         rc.app(None)
@@ -227,7 +229,7 @@
             return self.item.eventhandler(event)
 
         if event in ( PLAY_END, USER_END ):
-            self.stop()
+            self.stop(event)
             return self.item.eventhandler(event)
 
         if event == PAUSE or event == PLAY:
@@ -235,7 +237,7 @@
             return True
 
         if event == STOP:
-            self.stop()
+            self.stop(event)
             return self.item.eventhandler(event)
 
         if event == SEEK:

-------------------------------------------------------------------------
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