return FALSE;
} else {
structure = gst_structure_copy (e->subtract_from);
- gst_structure_id_set_value (structure, field_id, &subtraction);
- g_value_unset (&subtraction);
+ gst_structure_id_take_value (structure, field_id, &subtraction);
e->put_into = g_slist_prepend (e->put_into, structure);
return TRUE;
}
}
gst_value_init_and_copy (&val, gst_value_list_get_value (value, 0));
- gst_structure_id_set_value (nf->structure, field_id, &val);
- g_value_unset (&val);
-
+ gst_structure_id_take_value (nf->structure, field_id, &val);
return FALSE;
}
return TRUE;
* but at most one field: field.name */
if (G_IS_VALUE (&field.value)) {
if (gst_structure_n_fields (simplify) == gst_structure_n_fields (compare)) {
- gst_structure_id_set_value (compare, field.name, &field.value);
+ gst_structure_id_take_value (compare, field.name, &field.value);
*result = NULL;
ret = TRUE;
+ } else {
+ g_value_unset (&field.value);
}
- g_value_unset (&field.value);
} else if (gst_structure_n_fields (simplify) <=
gst_structure_n_fields (compare)) {
/* compare is just more specific, will be optimized away later */
GValue v = { 0 };
if (gst_value_fixate (&v, value)) {
- gst_structure_id_set_value (s, field_id, &v);
- g_value_unset (&v);
+ gst_structure_id_take_value (s, field_id, &v);
}
return TRUE;
}
} else {
GValue dest_value = { 0 };
if (gst_value_intersect (&dest_value, val1, val2)) {
- gst_structure_id_set_value (idata->dest, id, &dest_value);
- g_value_unset (&dest_value);
+ gst_structure_id_take_value (idata->dest, id, &dest_value);
} else {
return FALSE;
}
break;
case GST_TAG_MERGE_PREPEND:
gst_value_list_merge (&dest, value, value2);
- gst_structure_id_set_value (list, tag_quark, &dest);
- g_value_unset (&dest);
+ gst_structure_id_take_value (list, tag_quark, &dest);
break;
case GST_TAG_MERGE_APPEND:
gst_value_list_merge (&dest, value2, value);
- gst_structure_id_set_value (list, tag_quark, &dest);
- g_value_unset (&dest);
+ gst_structure_id_take_value (list, tag_quark, &dest);
break;
case GST_TAG_MERGE_KEEP:
case GST_TAG_MERGE_KEEP_ALL: