diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2010-01-23 21:43:13 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2010-01-23 21:43:13 +0100 |
commit | b25fd88cd2be2b3643f8aca4a5f83733d40c636c (patch) | |
tree | 68ea72df83219af87e88ab4c16a737e725450f25 | |
parent | a75edccd76990d664b962122ebcf2448b8e940e8 (diff) | |
download | totem-b25fd88cd2be2b3643f8aca4a5f83733d40c636c.tar.gz |
Flush playbin2's bus before reusing it
This makes sure that we don't get any messages from a previous URI.
Fixes bug #607224.
-rw-r--r-- | src/backend/bacon-video-widget-gst-0.10.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/backend/bacon-video-widget-gst-0.10.c b/src/backend/bacon-video-widget-gst-0.10.c index 205fc1dd7..01a03a366 100644 --- a/src/backend/bacon-video-widget-gst-0.10.c +++ b/src/backend/bacon-video-widget-gst-0.10.c @@ -3552,6 +3552,7 @@ bacon_video_widget_open (BaconVideoWidget * bvw, GFile *file; gboolean ret; char *path; + GstBus *bus; g_return_val_if_fail (bvw != NULL, FALSE); g_return_val_if_fail (mrl != NULL, FALSE); @@ -3631,9 +3632,18 @@ bacon_video_widget_open (BaconVideoWidget * bvw, bvw->priv->ready_idle_id = 0; } + /* Flush the bus to make sure we don't get any messages + * from the previous URI, see bug #607224. + */ + bus = gst_element_get_bus (bvw->priv->play); + gst_bus_set_flushing (bus, TRUE); + bvw->priv->target_state = GST_STATE_READY; gst_element_set_state (bvw->priv->play, GST_STATE_READY); + gst_bus_set_flushing (bus, FALSE); + gst_object_unref (bus); + g_object_set (bvw->priv->play, "uri", bvw->priv->mrl, "suburi", subtitle_uri, NULL); |