[rhythmbox] player-gst: emit playing-stream after setting playing=TRUE (bug #583394)
- From: Jonathan Matthew <jmatthew src gnome org>
- To: svn-commits-list gnome org
- Subject: [rhythmbox] player-gst: emit playing-stream after setting playing=TRUE (bug #583394)
- Date: Mon, 1 Jun 2009 04:16:23 -0400 (EDT)
commit 6ffddc262511e11bb61ac91423057e59533c61bb
Author: Jonathan Matthew <jonathan d14n org>
Date: Mon Jun 1 18:13:55 2009 +1000
player-gst: emit playing-stream after setting playing=TRUE (bug #583394)
playing-stream needs to be emitted at a point where rb_player_playing
will return TRUE, otherwise bits of the UI get out of sync.
---
backends/gstreamer/rb-player-gst.c | 15 ++++++---------
1 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/backends/gstreamer/rb-player-gst.c b/backends/gstreamer/rb-player-gst.c
index bcae010..5f124c5 100644
--- a/backends/gstreamer/rb-player-gst.c
+++ b/backends/gstreamer/rb-player-gst.c
@@ -646,14 +646,14 @@ impl_close (RBPlayer *player, const char *uri, GError **error)
{
RBPlayerGst *mp = RB_PLAYER_GST (player);
- mp->priv->playing = FALSE;
- mp->priv->buffering = FALSE;
-
if ((uri != NULL) && (mp->priv->uri != NULL) && strcmp (mp->priv->uri, uri) == 0) {
rb_debug ("URI doesn't match current playing URI; ignoring");
return TRUE;
}
+ mp->priv->playing = FALSE;
+ mp->priv->buffering = FALSE;
+
_destroy_stream_data (mp);
g_free (mp->priv->uri);
g_free (mp->priv->prev_uri);
@@ -729,10 +729,8 @@ impl_play (RBPlayer *player, gint crossfade, GError **error)
} else if (mp->priv->current_track_finishing) {
rb_debug ("current track finishing -> just setting URI on playbin");
g_object_set (mp->priv->playbin, "uri", mp->priv->uri, NULL);
-
- _rb_player_emit_playing_stream (RB_PLAYER (mp), mp->priv->stream_data);
-
result = TRUE;
+
} else {
gboolean cdda_seek = FALSE;
@@ -766,7 +764,6 @@ impl_play (RBPlayer *player, gint crossfade, GError **error)
GST_SEEK_TYPE_NONE, -1)) {
cdda_seek = TRUE;
result = TRUE;
- _rb_player_emit_playing_stream (RB_PLAYER (mp), mp->priv->stream_data);
}
} else {
/* +1 to skip the '#' */
@@ -784,8 +781,6 @@ impl_play (RBPlayer *player, gint crossfade, GError **error)
result = set_state_and_wait (mp, GST_STATE_READY, error);
if (result == TRUE) {
g_object_set (mp->priv->playbin, "uri", mp->priv->uri, NULL);
-
- _rb_player_emit_playing_stream (RB_PLAYER (mp), mp->priv->stream_data);
result = set_state_and_wait (mp, GST_STATE_PLAYING, error);
}
}
@@ -798,6 +793,8 @@ impl_play (RBPlayer *player, gint crossfade, GError **error)
mp->priv->buffering = FALSE;
mp->priv->playing = TRUE;
+ _rb_player_emit_playing_stream (RB_PLAYER (mp), mp->priv->stream_data);
+
if (mp->priv->tick_timeout_id == 0) {
mp->priv->tick_timeout_id =
g_timeout_add (1000 / RB_PLAYER_GST_TICK_HZ,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]