summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2015-03-19 09:21:23 +0100
committerOlivier Crête <olivier.crete@collabora.com>2015-03-27 19:37:08 -0400
commit555d7e570c7f19cb655fd3ece6c18258e4a02bc6 (patch)
treee68b43c418cbe45b885c8ded2e1bc04213b1d11c
parent0fdd03c4a93cdb8130391b25b62eefebd2412281 (diff)
downloadlibnice-555d7e570c7f19cb655fd3ece6c18258e4a02bc6.tar.gz
nicesrc: Clear the output buffer queue when shutting down and disposing
https://bugs.freedesktop.org/show_bug.cgi?id=89673
-rw-r--r--gst/gstnicesrc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gst/gstnicesrc.c b/gst/gstnicesrc.c
index 0c75c18..a113406 100644
--- a/gst/gstnicesrc.c
+++ b/gst/gstnicesrc.c
@@ -322,8 +322,10 @@ gst_nice_src_dispose (GObject *object)
g_main_context_unref (src->mainctx);
src->mainctx = NULL;
- if (src->outbufs)
+ if (src->outbufs) {
+ g_queue_foreach (src->outbufs, (GFunc) gst_buffer_unref, NULL);
g_queue_free (src->outbufs);
+ }
src->outbufs = NULL;
G_OBJECT_CLASS (gst_nice_src_parent_class)->dispose (object);
@@ -416,6 +418,10 @@ gst_nice_src_change_state (GstElement * element, GstStateChange transition)
case GST_STATE_CHANGE_READY_TO_NULL:
nice_agent_attach_recv (src->agent, src->stream_id, src->component_id,
src->mainctx, NULL, NULL);
+ GST_OBJECT_LOCK (src);
+ g_queue_foreach (src->outbufs, (GFunc) gst_buffer_unref, NULL);
+ g_queue_clear (src->outbufs);
+ GST_OBJECT_UNLOCK (src);
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
case GST_STATE_CHANGE_PAUSED_TO_PLAYING: