Author: duncan
Date: Wed Oct 11 08:14:29 2006
New Revision: 8346

Modified:
   branches/rel-1-5/freevo/src/tv/plugins/ivtv_xine_tv.py

Log:
[ 1574885 ] Fixed ivtv_xine_tv plugin
Fixes for df_xine


Modified: branches/rel-1-5/freevo/src/tv/plugins/ivtv_xine_tv.py
==============================================================================
--- branches/rel-1-5/freevo/src/tv/plugins/ivtv_xine_tv.py      (original)
+++ branches/rel-1-5/freevo/src/tv/plugins/ivtv_xine_tv.py      Wed Oct 11 
08:14:29 2006
@@ -4,9 +4,9 @@
 # -----------------------------------------------------------------------
 # $Id: mplayer.py 8338 2006-10-09 21:47:47Z duncan $
 #
+# Author: [EMAIL PROTECTED] (rvpaasen)
 # Notes:
-# Author: [EMAIL PROTECTED]
-# Todo:        
+# Todo:
 #
 # -----------------------------------------------------------------------
 # Freevo - A Home Theater PC framework
@@ -92,7 +92,7 @@
         self.prev_app = rc.app()
         rc.app(self)
 
-        self.tuner.SetChannel(mode, tuner_channel)
+        self.tuner.SetChannel(self.mode, tuner_channel)
         self.mixer.prepare()
         self.xine.play()
 
@@ -348,8 +348,9 @@
 
         if (self.mixer != None):
 
-            # XXX Hm.. This is hardcoded and very unflexible.
-            if mode == 'vcr':
+            # to be fixed...            
+            # if self.mode == 'vcr':
+            if 0:
                 self.mixer.setMicVolume(config.VCR_IN_VOLUME)
 
             else:
@@ -384,8 +385,13 @@
         self.item = item
         childapp.ChildApp2.__init__(self, app)
         _debug_('XineApp: Started, cmd=%s' % app)
-        # self.exit_type = None # ??
+        self.exit_type = None
+        self.done = False
 
+    def _kill_(self):
+
+        childapp.ChildApp2.kill(self,signal.SIGKILL)
+        self.done = True
 
 # ======================================================================
 
@@ -404,12 +410,18 @@
         self.mode = 'idle'
         self.start_flag = threading.Event()
 
-        print 'DJW: config.CONF.xine=%s' % (config.CONF.xine)
-        print 'DJW: config.XINE_COMMAND=%s' % (config.XINE_COMMAND)
-        print 'DJW: config.XINE_ARGS_DEF=%s' % (config.XINE_ARGS_DEF)
-        print 'DJW: config.XINE_TV_VO_DEV=%s' % (config.XINE_TV_VO_DEV)
-        print 'DJW: config.XINE_TV_AO_DEV=%s' % (config.XINE_TV_AO_DEV)
-        print 'DJW: config.XINE_TV_TIMESHIFT_FILEMASK=%s' % 
(config.XINE_TV_TIMESHIFT_FILEMASK)
+        if config.CONF.display in ('dfbmga', 'directfb', 'fbdev'):
+            self.fbxine = True
+        else:
+            self.fbxine = False
+
+        _debug_( 'config.CONF.xine=%s' % (config.CONF.xine) )
+        _debug_( 'config.XINE_COMMAND=%s' % (config.XINE_COMMAND) )
+        _debug_( 'config.XINE_ARGS_DEF=%s' % (config.XINE_ARGS_DEF) )
+        _debug_( 'config.XINE_TV_VO_DEV=%s' % (config.XINE_TV_VO_DEV) )
+        _debug_( 'config.XINE_TV_AO_DEV=%s' % (config.XINE_TV_AO_DEV) )
+        _debug_( 'config.XINE_TV_TIMESHIFT_FILEMASK=%s' % 
(config.XINE_TV_TIMESHIFT_FILEMASK) )
+
         self.command = '%s %s -V %s -A %s --stdctl pvr://%s' % \
             (config.XINE_COMMAND, config.XINE_ARGS_DEF, config.XINE_TV_VO_DEV, 
\
             config.XINE_TV_AO_DEV, config.XINE_TV_TIMESHIFT_FILEMASK)
@@ -428,8 +440,14 @@
     def stop(self):
 
         if (self.mode == 'busy') or (self.mode == 'pause'):
+
             self.mode = 'stop'
 
+            if self.fbxine == True:
+                while self.app.done == False:
+                    _debug_('waiting for xine to end...\n')
+                    time.sleep(0.1)
+
         while (self.mode == 'busy') or (self.mode == 'pause'):
             sleep(0.1)
 
@@ -458,10 +476,24 @@
                     self.mode = 'busy'
 
                 elif self.mode == 'stop':
-                    self.app.stop("quit\n")
 
+                    if self.fbxine == True:
+                        # directfb needs xine to be killed
+                        # else the display is messed up
+                        # and freevo crashes
+                        _debug_('killing xine')
+                        self.app._kill_()
+
+                    else:
+                        # cleanly stop xine otherwise and let it
+                        # delete the buffer files
+                        _debug_('stoppping xine')
+                        self.app.stop("quit\n")
 
-            self.mode = 'idle'
+                    self.mode = 'idle'
+
+            #_debug_('posting play_end')
+            #rc.post_event(PLAY_END)
 
             _debug_('XineThread: Stopped')
             self.mode = 'idle'

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to