omxvideodec: fix a query leak
authorAurélien Zanelli <aurelien.zanelli@darkosphere.fr>
Wed, 18 Jun 2014 21:04:33 +0000 (23:04 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Fri, 20 Jun 2014 09:54:25 +0000 (11:54 +0200)
Also add a debug message if query fails.

https://bugzilla.gnome.org/show_bug.cgi?id=731898

omx/gstomxvideodec.c

index 2fc7f19..eb52d13 100644 (file)
@@ -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;