3 The current player state is now notified via the state-changed signal,
4 and in the GTK UI it was only used to keep track of the desired state.
6 This is a backport of upstream commit 738479c7a0.
8 Upstream-Status: Backport
9 Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
12 gtk/gtk-play.c | 8 ++++++--
13 lib/gst/player/gstplayer.c | 12 ------------
14 lib/gst/player/gstplayer.h | 2 --
15 3 files changed, 6 insertions(+), 16 deletions(-)
17 diff --git a/gtk/gtk-play.c b/gtk/gtk-play.c
18 index 6e7a098..e2b605a 100644
21 @@ -34,6 +34,7 @@ typedef struct
23 GtkWidget *volume_button;
24 gulong seekbar_value_changed_signal_id;
29 @@ -118,12 +119,13 @@ play_pause_clicked_cb (GtkButton * button, GtkPlay * play)
33 - if (gst_player_is_playing (play->player)) {
34 + if (play->playing) {
35 gst_player_pause (play->player);
37 gtk_image_new_from_icon_name ("media-playback-start",
38 GTK_ICON_SIZE_BUTTON);
39 gtk_button_set_image (GTK_BUTTON (play->play_pause_button), image);
40 + play->playing = FALSE;
44 @@ -136,6 +138,7 @@ play_pause_clicked_cb (GtkButton * button, GtkPlay * play)
45 title = gst_player_get_uri (play->player);
46 set_title (play, title);
48 + play->playing = TRUE;
52 @@ -335,7 +338,7 @@ video_dimensions_changed_cb (GstPlayer * unused, gint width, gint height,
54 eos_cb (GstPlayer * unused, GtkPlay * play)
56 - if (gst_player_is_playing (play->player)) {
57 + if (play->playing) {
61 @@ -452,6 +455,7 @@ main (gint argc, gchar ** argv)
64 play.player = gst_player_new ();
65 + play.playing = TRUE;
67 g_object_set (play.player, "dispatch-to-main-context", TRUE, NULL);
69 diff --git a/lib/gst/player/gstplayer.c b/lib/gst/player/gstplayer.c
70 index 069b284..78e7ba1 100644
71 --- a/lib/gst/player/gstplayer.c
72 +++ b/lib/gst/player/gstplayer.c
73 @@ -1422,18 +1422,6 @@ gst_player_set_uri (GstPlayer * self, const gchar * val)
74 g_object_set (self, "uri", val, NULL);
78 -gst_player_is_playing (GstPlayer * self)
82 - g_return_val_if_fail (GST_IS_PLAYER (self), FALSE);
84 - g_object_get (self, "is-playing", &val, NULL);
90 gst_player_get_position (GstPlayer * self)
92 diff --git a/lib/gst/player/gstplayer.h b/lib/gst/player/gstplayer.h
93 index 6933dd7..35fb5bb 100644
94 --- a/lib/gst/player/gstplayer.h
95 +++ b/lib/gst/player/gstplayer.h
96 @@ -93,8 +93,6 @@ gchar * gst_player_get_uri (GstPlayer * player);
97 void gst_player_set_uri (GstPlayer * player,
100 -gboolean gst_player_is_playing (GstPlayer * player);
102 GstClockTime gst_player_get_position (GstPlayer * player);
103 GstClockTime gst_player_get_duration (GstPlayer * player);