rtspsrc: Don't propagate spurious state change returns from internal elements further
authorSebastian Dröge <sebastian@centricular.com>
Wed, 27 Apr 2016 15:27:17 +0000 (18:27 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 27 Apr 2016 17:52:15 +0000 (20:52 +0300)
We handle them inside rtspsrc and override them in all other cases anyway, so
do the same for "internal" state changes like PAUSED->PAUSED and
PLAYING->PLAYING.

This keeps unexpected NO_PREROLL to confuse state changes in GstBin.

See also https://bugzilla.gnome.org/show_bug.cgi?id=760532

https://bugzilla.gnome.org/show_bug.cgi?id=765689

gst/rtsp/gstrtspsrc.c

index 9b54dbc..1c218e7 100644 (file)
@@ -7790,6 +7790,16 @@ gst_rtspsrc_change_state (GstElement * element, GstStateChange transition)
       ret = GST_STATE_CHANGE_SUCCESS;
       break;
     default:
+      /* Otherwise it's success, we don't want to return spurious
+       * NO_PREROLL or ASYNC from internal elements as we care for
+       * state changes ourselves here
+       *
+       * This is to catch PAUSED->PAUSED and PLAYING->PLAYING transitions.
+       */
+      if (GST_STATE_TRANSITION_NEXT (transition) == GST_STATE_PAUSED)
+        ret = GST_STATE_CHANGE_NO_PREROLL;
+      else
+        ret = GST_STATE_CHANGE_SUCCESS;
       break;
   }