player: Don't set state to READY if we're already stopped
authorSebastian Dröge <sebastian@centricular.com>
Wed, 24 Oct 2018 13:34:13 +0000 (14:34 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 24 Oct 2018 13:36:41 +0000 (14:36 +0100)
Otherwise setting an URI after creation will already set the state
to READY/buffering and disallow setting the configuration.

See https://github.com/servo/servo/issues/22010

gst-libs/gst/player/gstplayer.c

index e45c1af..651d2a5 100644 (file)
@@ -3198,6 +3198,11 @@ gst_player_pause (GstPlayer * self)
 static void
 gst_player_stop_internal (GstPlayer * self, gboolean transient)
 {
+  /* directly return if we're already stopped */
+  if (self->current_state <= GST_STATE_READY &&
+      self->target_state <= GST_STATE_READY)
+    return;
+
   GST_DEBUG_OBJECT (self, "Stop (transient %d)", transient);
 
   tick_cb (self);