summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorVineeth T M <vineeth.tm@samsung.com>2015-07-07 19:35:40 +0900
committerLuis de Bethencourt <luis@debethencourt.com>2015-07-07 11:56:23 +0100
commitdb86c73f4d8a876b63acdeaf205b26baffc9aeca (patch)
tree8f376fa403c678e99ede86f1bfb6908466392cf1 /sys
parentcf454ca71358ca6f7d412488d98e27dd31d1bb18 (diff)
downloadgst-plugins-base-db86c73f4d8a876b63acdeaf205b26baffc9aeca.tar.gz
gst-plugins-base-db86c73f4d8a876b63acdeaf205b26baffc9aeca.tar.xz
ximagesink: fix navigation event leak
Create event only when pad is created and send the event to pad. https://bugzilla.gnome.org/show_bug.cgi?id=752041
Diffstat (limited to 'sys')
-rw-r--r--sys/ximage/ximagesink.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/sys/ximage/ximagesink.c b/sys/ximage/ximagesink.c
index 5be691d3d..a0eb5b488 100644
--- a/sys/ximage/ximagesink.c
+++ b/sys/ximage/ximagesink.c
@@ -1525,12 +1525,9 @@ gst_x_image_sink_navigation_send_event (GstNavigation * navigation,
GstStructure * structure)
{
GstXImageSink *ximagesink = GST_X_IMAGE_SINK (navigation);
- GstEvent *event;
+ GstEvent *event = NULL;
gint x_offset, y_offset;
gdouble x, y;
- GstPad *pad = NULL;
-
- event = gst_event_new_navigation (structure);
/* We are not converting the pointer coordinates as there's no hardware
scaling done here. The only possible scaling is done by videoscale and
@@ -1560,13 +1557,9 @@ gst_x_image_sink_navigation_send_event (GstNavigation * navigation,
gst_structure_set (structure, "pointer_y", G_TYPE_DOUBLE, y, NULL);
}
- pad = gst_pad_get_peer (GST_VIDEO_SINK_PAD (ximagesink));
-
- if (GST_IS_PAD (pad) && GST_IS_EVENT (event)) {
- gst_pad_send_event (pad, event);
-
- gst_object_unref (pad);
- }
+ event = gst_event_new_navigation (structure);
+ if (event)
+ gst_pad_push_event (GST_VIDEO_SINK_PAD (ximagesink), event);
}
static void