decodebin: free hidden groups at time of switching groups
authorRajat Verma <rajat.verma@st.com>
Tue, 29 Sep 2015 04:42:28 +0000 (10:12 +0530)
committerSebastian Dröge <sebastian@centricular.com>
Fri, 2 Oct 2015 14:02:21 +0000 (17:02 +0300)
hidden groups should be freed at time of switching groups to avoid memory use
from balloning up.

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

gst/playback/gstdecodebin2.c

index 85a2ed1..71336b0 100644 (file)
@@ -4061,7 +4061,6 @@ drain_and_switch_chains (GstDecodeChain * chain, GstDecodePad * drainpad,
       if (chain->next_groups) {
         /* Switch to next group */
         GST_DEBUG_OBJECT (dbin, "Hiding current group %p", chain->active_group);
-        gst_decode_chain_start_free_hidden_groups_thread (chain);
         gst_decode_group_hide (chain->active_group);
         chain->old_groups =
             g_list_prepend (chain->old_groups, chain->active_group);
@@ -4070,6 +4069,7 @@ drain_and_switch_chains (GstDecodeChain * chain, GstDecodePad * drainpad,
         chain->active_group = chain->next_groups->data;
         chain->next_groups =
             g_list_delete_link (chain->next_groups, chain->next_groups);
+        gst_decode_chain_start_free_hidden_groups_thread (chain);
         *switched = TRUE;
         chain->drained = FALSE;
       } else {