mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
lavu/opt: copy dict in av_opt_copy
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
This commit is contained in:
parent
457204ee15
commit
4e179436b6
@ -1595,6 +1595,15 @@ int av_opt_copy(void *dst, void *src)
|
||||
*(int*)(field_dst8 + 1) = len;
|
||||
} else if (o->type == AV_OPT_TYPE_CONST) {
|
||||
// do nothing
|
||||
} else if (o->type == AV_OPT_TYPE_DICT) {
|
||||
AVDictionary **sdict = (AVDictionary **) field_src;
|
||||
AVDictionary **ddict = (AVDictionary **) field_dst;
|
||||
if (*sdict != *ddict)
|
||||
av_dict_free(ddict);
|
||||
*ddict = NULL;
|
||||
av_dict_copy(ddict, *sdict, 0);
|
||||
if (av_dict_count(*sdict) != av_dict_count(*ddict))
|
||||
ret = AVERROR(ENOMEM);
|
||||
} else {
|
||||
memcpy(field_dst, field_src, opt_size(o->type));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user