From 3b9138c4a0d91b2532c701f456252f7fc7e7cc62 Mon Sep 17 00:00:00 2001 From: Nils Hasler Date: Mon, 25 Apr 2011 09:04:15 +0000 Subject: [PATCH] fixed jump over initialisation bug. --- modules/highgui/src/cap_gstreamer.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/highgui/src/cap_gstreamer.cpp b/modules/highgui/src/cap_gstreamer.cpp index 8a25f25..2615872 100644 --- a/modules/highgui/src/cap_gstreamer.cpp +++ b/modules/highgui/src/cap_gstreamer.cpp @@ -381,13 +381,16 @@ bool CvCapture_GStreamer::open( int type, const char* filename ) gst_app_sink_set_max_buffers (GST_APP_SINK(sink), 1); gst_app_sink_set_drop (GST_APP_SINK(sink), stream); - GstCaps* caps= gst_caps_new_simple("video/x-raw-rgb", - "red_mask", G_TYPE_INT, 0x0000FF, - "green_mask", G_TYPE_INT, 0x00FF00, - "blue_mask", G_TYPE_INT, 0xFF0000, - NULL); + { + GstCaps* caps; + caps = gst_caps_new_simple("video/x-raw-rgb", + "red_mask", G_TYPE_INT, 0x0000FF, + "green_mask", G_TYPE_INT, 0x00FF00, + "blue_mask", G_TYPE_INT, 0xFF0000, + NULL); gst_app_sink_set_caps(GST_APP_SINK(sink), caps); gst_caps_unref(caps); + } if(gst_element_set_state(GST_ELEMENT(pipeline), GST_STATE_READY) == GST_STATE_CHANGE_FAILURE) { -- 2.7.4