[Swfdec-commits] swfdec-gtk/swfdec_playback_pa.c

Eric Anholt anholt at kemper.freedesktop.org
Tue Apr 8 21:03:33 PDT 2008


 swfdec-gtk/swfdec_playback_pa.c |   19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

New commits:
commit 782d17b6c2a7bc369f3f4bac85e648199eeb6e2c
Author: Riccardo Magliocchetti <riccardo at datahost.it>
Date:   Tue Apr 8 21:01:37 2008 -0700

    Bug #13604: Fix assertion failure on PA error draining streams.
    
    This was triggered by seeking in youtube videos.  More issues remain with
    audio while seeking (lots of glib assertion failures about audio objects,
    crash later on), but this avoids the most common error.

diff --git a/swfdec-gtk/swfdec_playback_pa.c b/swfdec-gtk/swfdec_playback_pa.c
index 755b033..55b05c2 100644
--- a/swfdec-gtk/swfdec_playback_pa.c
+++ b/swfdec-gtk/swfdec_playback_pa.c
@@ -119,14 +119,21 @@ swfdec_playback_stream_close (Stream *stream)
 
   /* If we have created a PA stream, defer freeing until we drain it. */
   if (stream->pa != NULL) {
+    pa_operation *o;
+
     stream->no_more = 1;
-    pa_operation_unref (pa_stream_drain (stream->pa,
-					 stream_drain_complete,
-					 stream));
-  } else {
-    g_object_unref (stream->audio);
-    g_free (stream);
+
+    o = pa_stream_drain (stream->pa, stream_drain_complete, stream);
+    if (o != NULL) {
+      pa_operation_unref (o);
+      return;
+    } else {
+      g_printerr("PA stream drain failed: %s\n",
+		 pa_strerror(pa_context_errno(stream->sound->pa)));
+    }
   }
+  g_object_unref (stream->audio);
+  g_free (stream);
 }
 
 static void


More information about the Swfdec-commits mailing list