diff options
author | Thiago Santos <ts.santos@sisa.samsung.com> | 2014-05-30 02:10:25 -0300 |
---|---|---|
committer | Thiago Santos <ts.santos@sisa.samsung.com> | 2014-05-30 02:10:45 -0300 |
commit | 0ae4bc74ba3cedcb59b92804d5fb798a9b097a55 (patch) | |
tree | 7706d91f3352cd67aa2a377716d82e0753d2f22b /gst | |
parent | 0f4485fc66eb1fa46a4a924a82a4a6e43b12aacc (diff) | |
download | gstreamer-plugins-bad-0ae4bc74ba3cedcb59b92804d5fb798a9b097a55.tar.gz |
camerabin: fix structure handling in preview message
Avoid trying to modify the message structure as it isn't mutable.
Use a copy and post a new message if necessary.
Fixes failing tests.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/camerabin2/gstcamerabin2.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gst/camerabin2/gstcamerabin2.c b/gst/camerabin2/gstcamerabin2.c index e651a351c..c77585a1e 100644 --- a/gst/camerabin2/gstcamerabin2.c +++ b/gst/camerabin2/gstcamerabin2.c @@ -1056,11 +1056,20 @@ gst_camera_bin_handle_message (GstBin * bin, GstMessage * message) g_mutex_unlock (&camerabin->preview_list_mutex); if (location) { + GstStructure *new_structure; GValue value = { 0 }; + g_value_init (&value, G_TYPE_STRING); g_value_take_string (&value, location); - gst_structure_take_value ((GstStructure *) structure, "location", - &value); + + /* need to do a copy because the structure isn't mutable */ + new_structure = gst_structure_copy (structure); + gst_structure_take_value (new_structure, "location", &value); + + gst_message_unref (message); + message = + gst_message_new_element (GST_OBJECT_CAST (camerabin), + new_structure); } GST_LOG_OBJECT (bin, "received preview-image message"); |