vaapisink: Fix event,pad,structure memory leaks

https://bugzilla.gnome.org/show_bug.cgi?id=762229
This commit is contained in:
Vineeth TM 2016-02-18 10:13:53 +09:00 committed by Thiago Santos
parent ce1ab4673c
commit 24bc53456c

View file

@ -836,6 +836,11 @@ gst_vaapisink_navigation_send_event (GstNavigation * navigation,
GstVaapiSink *const sink = GST_VAAPISINK (navigation);
GstPad *peer;
if (!sink->window) {
gst_structure_free (structure);
return;
}
if ((peer = gst_pad_get_peer (GST_VAAPI_PLUGIN_BASE_SINK_PAD (sink)))) {
GstEvent *event;
GstVaapiRectangle *disp_rect = &sink->display_rect;
@ -843,9 +848,6 @@ gst_vaapisink_navigation_send_event (GstNavigation * navigation,
event = gst_event_new_navigation (structure);
if (!sink->window)
return;
/* We calculate scaling using the original video frames geometry to include
pixel aspect ratio scaling. */
xscale = (gdouble) sink->video_width / disp_rect->width;