mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-23 19:30:05 +00: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;
|
*(int*)(field_dst8 + 1) = len;
|
||||||
} else if (o->type == AV_OPT_TYPE_CONST) {
|
} else if (o->type == AV_OPT_TYPE_CONST) {
|
||||||
// do nothing
|
// 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 {
|
} else {
|
||||||
memcpy(field_dst, field_src, opt_size(o->type));
|
memcpy(field_dst, field_src, opt_size(o->type));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user