Aggiunto qualche messaggio di debug temporaneo e corretto un piccolo bug

Leonardo Robol [2009-11-04 07:55]
Aggiunto qualche messaggio di debug temporaneo e corretto un piccolo bug
nella terminazione del thread player che non risponde
Filename
RaiTV/Interface.py
RaiTV/VideoWidget.py
diff --git a/RaiTV/Interface.py b/RaiTV/Interface.py
index db603e0..9c86c39 100644
--- a/RaiTV/Interface.py
+++ b/RaiTV/Interface.py
@@ -104,10 +104,6 @@ class UI():
         self.videowidget.load_video(mmsurl)
         self.sb_info("Connessione riuscita")

-    def start_video(self):
-        """Avvia il video"""
-        self.videowidget.registerXID()
-

     def destroy(self, w):
         """Chiamata per distruggere l'interfaccia"""
diff --git a/RaiTV/VideoWidget.py b/RaiTV/VideoWidget.py
index 2aa0011..51b82f1 100644
--- a/RaiTV/VideoWidget.py
+++ b/RaiTV/VideoWidget.py
@@ -131,8 +131,12 @@ class VideoWidget(gtk.DrawingArea):
         if self.playing:
             self.stop()

+        print " => Buono, video stoppati"
+
         self.player = GstPlayer(self.window.xid, uri)
+        print " => Player creato"
         self.player.start()
+        print " => Player avviato"
         self.playing = True

         ## Aspettiamo 5 secondi
@@ -146,10 +150,10 @@ class VideoWidget(gtk.DrawingArea):
         self.playing = False
         if self.player is not None:
             self.player.exit()
-            self.player.join(2)
-        if self.player.isAlive():
-            print " => Ops, l'ho ucciso brutalmente"
-            del self.player
+            self.player.join(timeout=2)
+            if self.player.isAlive():
+                print " => Ops, l'ho ucciso brutalmente"
+                del self.player


     def play(self):
ViewGit