rtspsrc: set PLAYING state after configuring caps
authorAleix Conchillo Flaqué <aleix@oblong.com>
Fri, 21 Nov 2014 19:39:19 +0000 (11:39 -0800)
committerTim-Philipp Müller <tim@centricular.com>
Wed, 31 Dec 2014 12:49:11 +0000 (12:49 +0000)
We set to PLAYING after we have configured the caps, otherwise we
might end up calling request_key (with SRTP) while caps are still
being configured, ending in a crash.

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

gst/rtsp/gstrtspsrc.c

index fc3ab88..6064248 100644 (file)
@@ -7426,8 +7426,6 @@ gst_rtspsrc_play (GstRTSPSrc * src, GstSegment * segment, gboolean async)
   if (src->manager)
     g_signal_emit_by_name (src->manager, "reset-sync", NULL);
 
-  gst_rtspsrc_set_state (src, GST_STATE_PLAYING);
-
   /* construct a control url */
   control = get_aggregate_control (src);
 
@@ -7549,6 +7547,11 @@ gst_rtspsrc_play (GstRTSPSrc * src, GstSegment * segment, gboolean async)
    * the manager object when we set a new Range header (we did a seek) */
   gst_rtspsrc_configure_caps (src, segment, src->need_range);
 
+  /* set to PLAYING after we have configured the caps, otherwise we
+   * might end up calling request_key (with SRTP) while caps are still
+   * being configured. */
+  gst_rtspsrc_set_state (src, GST_STATE_PLAYING);
+
   /* set again when needed */
   src->need_range = FALSE;