videorate: Don't leak the pools
authorNicolas Dufresne <nicolas.dufresne@collabora.co.uk>
Tue, 24 Mar 2015 19:18:36 +0000 (15:18 -0400)
committerNicolas Dufresne <nicolas.dufresne@collabora.co.uk>
Tue, 24 Mar 2015 19:23:34 +0000 (15:23 -0400)
gst_query_set_nth_alloction_pool() is transfer none on the pool, so we must
unref the pool when done.

gst/videorate/gstvideorate.c

index 1aaf021..401f09e 100644 (file)
@@ -892,7 +892,7 @@ gst_video_rate_propose_allocation (GstBaseTransform * trans,
     n_allocation = gst_query_get_n_allocation_pools (query);
 
     while (i < n_allocation) {
     n_allocation = gst_query_get_n_allocation_pools (query);
 
     while (i < n_allocation) {
-      GstBufferPool *pool;
+      GstBufferPool *pool = NULL;
       guint size, min, max;
 
       gst_query_parse_nth_allocation_pool (query, i, &pool, &size, &min, &max);
       guint size, min, max;
 
       gst_query_parse_nth_allocation_pool (query, i, &pool, &size, &min, &max);
@@ -907,6 +907,8 @@ gst_video_rate_propose_allocation (GstBaseTransform * trans,
       }
 
       gst_query_set_nth_allocation_pool (query, i, pool, size, min + 1, max);
       }
 
       gst_query_set_nth_allocation_pool (query, i, pool, size, min + 1, max);
+      if (pool)
+        gst_object_unref (pool);
       i++;
     }
 
       i++;
     }