From 9685e7a5835a0b532003832a5cde84e24aaf8ed0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=B6ran=20J=C3=B6nsson?= Date: Wed, 23 Apr 2014 08:06:36 +0200 Subject: [PATCH] rtspconnection: Empty queue when flush. Empty the watchs queue when calling gst_rtsp_watch_set_flushing with flushing variabel is TRUE. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=728772 --- gst-libs/gst/rtsp/gstrtspconnection.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/rtsp/gstrtspconnection.c b/gst-libs/gst/rtsp/gstrtspconnection.c index ac53f15c43..7ab28ca0dc 100644 --- a/gst-libs/gst/rtsp/gstrtspconnection.c +++ b/gst-libs/gst/rtsp/gstrtspconnection.c @@ -3807,7 +3807,7 @@ timeout: * * When @flushing is %TRUE, abort a call to gst_rtsp_watch_wait_backlog() * and make sure gst_rtsp_watch_write_data() returns immediately with - * #GST_RTSP_EINTR. + * #GST_RTSP_EINTR. And empty the queue. * * Since: 1.4 */ @@ -3819,5 +3819,9 @@ gst_rtsp_watch_set_flushing (GstRTSPWatch * watch, gboolean flushing) g_mutex_lock (&watch->mutex); watch->flushing = flushing; g_cond_signal (&watch->queue_not_full); + if (flushing == TRUE) { + g_queue_foreach (watch->messages, (GFunc) gst_rtsp_rec_free, NULL); + g_queue_clear (watch->messages); + } g_mutex_unlock (&watch->mutex); } -- 2.34.1