gstvalue: Avoid temporary allocation
authorEdward Hervey <edward@centricular.com>
Sat, 21 Mar 2020 12:05:33 +0000 (13:05 +0100)
committerSebastian Dröge <slomo@coaxion.net>
Tue, 5 May 2020 10:17:49 +0000 (10:17 +0000)
commitee4d2f91785dd149baf026d5425914e19fa626d8
treefebd167eaa5bb407eefa970b4db297a7ec0c666a
parent62f553873b6664d3bc37e7a25168f6fdda69ed78
gstvalue: Avoid temporary allocation

The problem is that:
* g_value_init will end up allocating an internal list/array
* g_value_copy *clears* the existing value by calling the free func
  and then the copy function (creating it again)

To avoid that alloc/free/alloc cycle, directly call the appropriate
function

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/453>
gst/gstvalue.c