From: Wim Taymans Date: Tue, 11 Sep 2012 08:56:43 +0000 (+0200) Subject: videoscale: improve handling of navigation events X-Git-Tag: RELEASE-0.11.94~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=280e504ae5f18f7c2137aef0ba96c974ae7c615e;p=platform%2Fupstream%2Fgst-plugins-base.git videoscale: improve handling of navigation events Only make the navigation event writable when we need to change it. --- diff --git a/gst/videoscale/gstvideoscale.c b/gst/videoscale/gstvideoscale.c index 44d9fff..7233f3f 100644 --- a/gst/videoscale/gstvideoscale.c +++ b/gst/videoscale/gstvideoscale.c @@ -1412,17 +1412,20 @@ gst_video_scale_src_event (GstBaseTransform * trans, GstEvent * event) switch (GST_EVENT_TYPE (event)) { case GST_EVENT_NAVIGATION: - event = - GST_EVENT (gst_mini_object_make_writable (GST_MINI_OBJECT (event))); - - structure = (GstStructure *) gst_event_get_structure (event); - if (gst_structure_get_double (structure, "pointer_x", &a)) { - gst_structure_set (structure, "pointer_x", G_TYPE_DOUBLE, - a * filter->in_info.width / filter->out_info.width, NULL); - } - if (gst_structure_get_double (structure, "pointer_y", &a)) { - gst_structure_set (structure, "pointer_y", G_TYPE_DOUBLE, - a * filter->in_info.height / filter->out_info.height, NULL); + if (filter->in_info.width != filter->out_info.width || + filter->in_info.height != filter->out_info.height) { + event = + GST_EVENT (gst_mini_object_make_writable (GST_MINI_OBJECT (event))); + + structure = (GstStructure *) gst_event_get_structure (event); + if (gst_structure_get_double (structure, "pointer_x", &a)) { + gst_structure_set (structure, "pointer_x", G_TYPE_DOUBLE, + a * filter->in_info.width / filter->out_info.width, NULL); + } + if (gst_structure_get_double (structure, "pointer_y", &a)) { + gst_structure_set (structure, "pointer_y", G_TYPE_DOUBLE, + a * filter->in_info.height / filter->out_info.height, NULL); + } } break; default: