xvimagesink: fix navigation event leak when not handled

gst_navigation_message_new_event() is *not* consuming the event so we should
always drop our extra reference.

https://bugzilla.gnome.org/show_bug.cgi?id=748903
This commit is contained in:
Guillaume Desmottes 2015-05-04 18:00:18 +02:00 committed by Thiago Santos
parent f90bb8140d
commit 9d85e23c3d

View file

@ -1185,8 +1185,6 @@ gst_xvimagesink_navigation_send_event (GstNavigation * navigation,
gst_event_ref (event); gst_event_ref (event);
handled = gst_pad_send_event (peer, event); handled = gst_pad_send_event (peer, event);
if (handled)
gst_event_unref (event);
gst_object_unref (peer); gst_object_unref (peer);
} }
@ -1194,6 +1192,9 @@ gst_xvimagesink_navigation_send_event (GstNavigation * navigation,
gst_element_post_message ((GstElement *) xvimagesink, gst_element_post_message ((GstElement *) xvimagesink,
gst_navigation_message_new_event ((GstObject *) xvimagesink, event)); gst_navigation_message_new_event ((GstObject *) xvimagesink, event));
} }
if (event)
gst_event_unref (event);
} }
static void static void