mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-24 08:08:22 +00:00
rtspsrc: fix race in state change to paused
When we go to paused, we first flush the connection and then send the pause command. As a result of the flushing, the scheduled paused command can get lost. Wait until the connection is completely flushed and the rtsp task is waiting before issuing the paused or playing request. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=702705
This commit is contained in:
parent
8428423c04
commit
b96d931bf4
1 changed files with 4 additions and 1 deletions
|
@ -4342,7 +4342,7 @@ gst_rtspsrc_loop_send_cmd (GstRTSPSrc * src, gint cmd, gint mask)
|
||||||
src->pending_cmd = CMD_WAIT;
|
src->pending_cmd = CMD_WAIT;
|
||||||
GST_OBJECT_UNLOCK (src);
|
GST_OBJECT_UNLOCK (src);
|
||||||
/* cancel previous request */
|
/* cancel previous request */
|
||||||
GST_DEBUG_OBJECT (src, "cancel previous request");
|
GST_DEBUG_OBJECT (src, "cancel previous request %d", old);
|
||||||
gst_rtspsrc_loop_cancel_cmd (src, old);
|
gst_rtspsrc_loop_cancel_cmd (src, old);
|
||||||
GST_OBJECT_LOCK (src);
|
GST_OBJECT_LOCK (src);
|
||||||
}
|
}
|
||||||
|
@ -6945,6 +6945,9 @@ gst_rtspsrc_change_state (GstElement * element, GstStateChange transition)
|
||||||
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
||||||
/* unblock the tcp tasks and make the loop waiting */
|
/* unblock the tcp tasks and make the loop waiting */
|
||||||
gst_rtspsrc_loop_send_cmd (rtspsrc, CMD_WAIT, CMD_LOOP);
|
gst_rtspsrc_loop_send_cmd (rtspsrc, CMD_WAIT, CMD_LOOP);
|
||||||
|
/* make sure it is waiting before we send PAUSE or PLAY below */
|
||||||
|
GST_RTSP_STREAM_LOCK (rtspsrc);
|
||||||
|
GST_RTSP_STREAM_UNLOCK (rtspsrc);
|
||||||
break;
|
break;
|
||||||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue