rpms/rhythmbox/devel rhythmbox-0.11.5-xfade-deadlock.patch, NONE, 1.1 rhythmbox.spec, 1.184, 1.185

Bastien Nocera (hadess) fedora-extras-commits at redhat.com
Mon Apr 7 08:44:39 UTC 2008


Author: hadess

Update of /cvs/pkgs/rpms/rhythmbox/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16882

Modified Files:
	rhythmbox.spec 
Added Files:
	rhythmbox-0.11.5-xfade-deadlock.patch 
Log Message:
* Mon Apr 07 2008 - Bastien Nocera <bnocera at redhat.com> - 0.11.5-8
- Add patch to avoid deadlocks when playing music through the cross-fade backend


rhythmbox-0.11.5-xfade-deadlock.patch:

--- NEW FILE rhythmbox-0.11.5-xfade-deadlock.patch ---
diff --git a/backends/gstreamer/rb-player-gst-xfade.c b/backends/gstreamer/rb-player-gst-xfade.c
index 189e0af..0131938 100644
--- a/backends/gstreamer/rb-player-gst-xfade.c
+++ b/backends/gstreamer/rb-player-gst-xfade.c
@@ -797,14 +797,17 @@ emit_stream_error_cb (RBXFadeStream *stream)
 static void
 emit_stream_error (RBXFadeStream *stream, GError *error)
 {
+	g_static_rec_mutex_lock (&stream->player->priv->stream_list_lock);
+
 	if (stream->error_idle_id != 0) {
 		g_error_free (error);
-		return;
+	} else {
+		stream->error = error;
+		stream->error_idle_id = g_idle_add ((GSourceFunc) emit_stream_error_cb,
+						    stream);
 	}
 
-	stream->error = error;
-	stream->error_idle_id = g_idle_add ((GSourceFunc) emit_stream_error_cb,
-					    stream);
+	g_static_rec_mutex_unlock (&stream->player->priv->stream_list_lock);
 }
 
 static void
@@ -2161,6 +2164,7 @@ actually_start_stream (RBXFadeStream *stream, GError **error)
 {
 	RBPlayerGstXFade *player = stream->player;
 	gboolean ret = TRUE;
+	gboolean need_reap = FALSE;
 
 	g_static_rec_mutex_lock (&player->priv->stream_list_lock);
 
@@ -2198,7 +2202,8 @@ actually_start_stream (RBXFadeStream *stream, GError **error)
 			case PREROLLING:
 			case PREROLL_PLAY:
 				rb_debug ("stream %s is paused; replacing it", pstream->uri);
-				unlink_and_dispose_stream (player, pstream);
+				pstream->state = PENDING_REMOVE;
+				need_reap = TRUE;
 				break;
 
 			default:
@@ -2236,13 +2241,14 @@ actually_start_stream (RBXFadeStream *stream, GError **error)
 				break;
 			case PAUSED:
 				rb_debug ("stream %s is paused; replacing it", pstream->uri);
-				unlink_and_dispose_stream (player, pstream);
+				pstream->state = PENDING_REMOVE;
+				need_reap = TRUE;
 				break;
 			default:
 				break;
 			}
 		}
-
+	
 		if (playing) {
 			/* wait for current stream's EOS */
 			rb_debug ("existing playing stream found; waiting for its EOS -> WAITING_EOS");
@@ -2252,11 +2258,7 @@ actually_start_stream (RBXFadeStream *stream, GError **error)
 			ret = link_and_unblock_stream (stream, error);
 		}
 	} else {
-		/* replace any existing playing stream.
-		 * might need to use schedule_stream_reap instead of
-		 * doing it directly, since we can get in here on a streaming
-		 * thread..  hmm.
-		 */
+		/* replace any existing playing stream */
 		GList *l;
 		for (l = player->priv->streams; l != NULL; l = l->next) {
 			RBXFadeStream *pstream = (RBXFadeStream *)l->data;
@@ -2269,7 +2271,8 @@ actually_start_stream (RBXFadeStream *stream, GError **error)
 			case FADING_IN:
 				/* kill this one */
 				rb_debug ("stopping stream %s (replaced by new stream)", pstream->uri);
-				unlink_and_dispose_stream (player, pstream);
+				need_reap = TRUE;
+				pstream->state = PENDING_REMOVE;
 				break;
 
 			default:
@@ -2281,6 +2284,10 @@ actually_start_stream (RBXFadeStream *stream, GError **error)
 		ret = link_and_unblock_stream (stream, error);
 	}
 
+	if (need_reap) {
+		schedule_stream_reap (player);
+	}
+
 	g_static_rec_mutex_unlock (&player->priv->stream_list_lock);
 
 	return ret;


Index: rhythmbox.spec
===================================================================
RCS file: /cvs/pkgs/rpms/rhythmbox/devel/rhythmbox.spec,v
retrieving revision 1.184
retrieving revision 1.185
diff -u -r1.184 -r1.185
--- rhythmbox.spec	4 Apr 2008 13:46:35 -0000	1.184
+++ rhythmbox.spec	7 Apr 2008 08:43:53 -0000	1.185
@@ -66,6 +66,8 @@
 # http://bugzilla.gnome.org/show_bug.cgi?id=374078
 # https://bugzilla.redhat.com/show_bug.cgi?id=440668
 Patch6: rhythmbox-0.11.5-ipod-vfat.patch
+# http://bugzilla.gnome.org/show_bug.cgi?id=512226
+Patch7: rhythmbox-0.11.5-xfade-deadlock.patch
 
 %description
 Rhythmbox is an integrated music management application based on the powerful
@@ -101,6 +103,7 @@
 %patch4 -p0 -b .force-podcast
 %patch5 -p0 -b .cdda-activation
 %patch6 -p0 -b .ipod-vfat
+%patch7 -p1 -b .xfade-deadlock
 
 %build
 # work around a gstreamer bug
@@ -214,6 +217,9 @@
 %{_libdir}/rhythmbox/plugins/upnp_coherence
 
 %changelog
+* Mon Apr 07 2008 - Bastien Nocera <bnocera at redhat.com> - 0.11.5-8
+- Add patch to avoid deadlocks when playing music through the cross-fade backend
+
 * Fri Apr 04 2008 - Bastien Nocera <bnocera at redhat.com> - 0.11.5-7
 - Add patch to work-around transfer of some filenames to VFAT iPods (#440668)
 




More information about the fedora-extras-commits mailing list