options/m_option: support duplicating MPV_FORMAT_BYTE_ARRAY nodes

This commit is contained in:
rcombs 2022-12-15 19:19:36 -06:00
parent 3b2b47e32a
commit 0b3c37bc43
1 changed files with 10 additions and 0 deletions

View File

@ -3774,6 +3774,16 @@ static void dup_node(void *ta_parent, struct mpv_node *node)
} }
break; break;
} }
case MPV_FORMAT_BYTE_ARRAY: {
struct mpv_byte_array *old = node->u.ba;
struct mpv_byte_array *new = talloc_zero(ta_parent, struct mpv_byte_array);
node->u.ba = new;
if (old->size > 0) {
*new = *old;
new->data = talloc_memdup(new, old->data, old->size);
}
break;
}
case MPV_FORMAT_NONE: case MPV_FORMAT_NONE:
case MPV_FORMAT_FLAG: case MPV_FORMAT_FLAG:
case MPV_FORMAT_INT64: case MPV_FORMAT_INT64: