From 58aa603b36eb74cf54d492381c6a9f98cd9c3678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Zanelli?= Date: Wed, 18 Jun 2014 23:04:33 +0200 Subject: [PATCH] omxvideodec: fix a query leak Also add a debug message if query fails. https://bugzilla.gnome.org/show_bug.cgi?id=731898 --- omx/gstomxvideodec.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c index 2fc7f194da..eb52d13a15 100644 --- a/omx/gstomxvideodec.c +++ b/omx/gstomxvideodec.c @@ -1504,9 +1504,12 @@ eos: { g_mutex_lock (&self->drain_lock); if (self->draining) { + GstQuery *query = gst_query_new_drain (); + /* Drain the pipeline to reclaim all memories back to the pool */ - gst_pad_peer_query (GST_VIDEO_DECODER_SRC_PAD (self), - gst_query_new_drain ()); + if (!gst_pad_peer_query (GST_VIDEO_DECODER_SRC_PAD (self), query)) + GST_DEBUG_OBJECT (self, "drain query failed"); + gst_query_unref (query); GST_DEBUG_OBJECT (self, "Drained"); self->draining = FALSE;