From f7e494f348b002a85198b665b64684dcc8383e18 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Sat, 17 Feb 2024 23:33:26 +1100 Subject: [PATCH] rtspsrc: Reset combined flows after a seek before restarting After a flushing seek, rtspsrc doesn't reset the last_ret value for streams, so might immediately shut down again when it resumes pushing buffers to pads due to a cached `GST_FLOW_FLUSHING` result Prevent a stored flushing value from immediately stopping playback again by resetting pad flows before (re)starting playback. Part-of: --- subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c b/subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c index 7bce71c3a8..8810f4141f 100644 --- a/subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c +++ b/subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c @@ -474,6 +474,8 @@ static GstFlowReturn gst_rtspsrc_push_backchannel_buffer (GstRTSPSrc * src, static GstFlowReturn gst_rtspsrc_push_backchannel_sample (GstRTSPSrc * src, guint id, GstSample * sample); +static void gst_rtspsrc_reset_flows (GstRTSPSrc * src); + typedef struct { guint8 pt; @@ -2852,6 +2854,7 @@ gst_rtspsrc_flush (GstRTSPSrc * src, gboolean flush, gboolean playing) state = GST_STATE_PAUSED; } gst_rtspsrc_push_event (src, event); + gst_rtspsrc_reset_flows (src); gst_rtspsrc_loop_send_cmd (src, cmd, CMD_LOOP); gst_rtspsrc_set_state (src, state); } @@ -5229,6 +5232,15 @@ done: return ret; } +static void +gst_rtspsrc_reset_flows (GstRTSPSrc * src) +{ + for (GList * streams = src->streams; streams; streams = g_list_next (streams)) { + GstRTSPStream *ostream = (GstRTSPStream *) streams->data; + ostream->last_ret = GST_FLOW_OK; + } +} + static gboolean gst_rtspsrc_stream_push_event (GstRTSPSrc * src, GstRTSPStream * stream, GstEvent * event)