playback: Fix leak on select_streams

Since gst_event_parse_select_streams() returns newly allocated
memory for stream-id(s), it should be freed explicitly.

https://bugzilla.gnome.org/show_bug.cgi?id=775553
This commit is contained in:
Seungha Yang 2016-12-03 12:43:22 +09:00 committed by Edward Hervey
parent b8c78c87d2
commit 10fe0497b2
2 changed files with 14 additions and 3 deletions

View file

@ -2403,8 +2403,10 @@ ghost_pad_event_probe (GstPad * pad, GstPadProbeInfo * info,
gst_event_unref (event);
}
/* Finally handle the switch */
if (streams)
if (streams) {
handle_stream_switch (dbin, streams, seqnum);
g_list_free_full (streams, g_free);
}
ret = GST_PAD_PROBE_HANDLED;
}
break;
@ -2450,8 +2452,10 @@ gst_decodebin3_send_event (GstElement * element, GstEvent * event)
}
#endif
/* Finally handle the switch */
if (streams)
if (streams) {
handle_stream_switch (dbin, streams, seqnum);
g_list_free_full (streams, g_free);
}
gst_event_unref (event);
return TRUE;

View file

@ -2371,7 +2371,14 @@ update_select_streams_event (GstPlayBin3 * playbin, GstEvent * event)
}
gst_event_unref (event);
return gst_event_new_select_streams (to_use);
event = gst_event_new_select_streams (to_use);
if (streams)
g_list_free_full (streams, g_free);
if (to_use)
g_list_free_full (to_use, g_free);
return event;
}
static gboolean