From f37afdafff1fd0a339966116261f5cd0de53f5d1 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Tue, 16 Mar 2021 00:08:43 +0530 Subject: [PATCH] rtspsrc: Fix state changes from PAUSED to PLAYING This was accidentally broken in the last commit that touched this because I missed the fall-through in the case immediately above this. Part-of: --- gst/rtsp/gstrtspsrc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index 3d3cc38..bce6b0d 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -9224,9 +9224,12 @@ gst_rtspsrc_change_state (GstElement * element, GstStateChange transition) set_manager_buffer_mode (rtspsrc); /* fall-through */ case GST_STATE_CHANGE_PLAYING_TO_PAUSED: - if (rtspsrc->is_live && (GST_STATE_TARGET (element) == GST_STATE_PAUSED)) { - /* unblock the tcp tasks only if rtspsrc is going to PAUSED (not if - * it's going to NULL) and make the loop waiting */ + if (rtspsrc->is_live && + (transition == GST_STATE_CHANGE_PAUSED_TO_PLAYING || + GST_STATE_TARGET (element) == GST_STATE_PAUSED)) { + /* Unblock the tcp tasks and make the loop waiting. But if the state + * transition is PLAY->PAUSE, then only do this if the final target + * state is PAUSED */ if (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); -- 2.7.4