[mpp_meta]: Clear value on get_env failed

NOTE: s32 and s64 value can not be cleared to zero for it may have
initialized invalid value.

Change-Id: Iea9f36600b051584de34d8ac1782a897c64dcd2f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
Herman Chen
2020-03-11 15:37:13 +08:00
parent 45e2b89d5d
commit fd6aef3a02

View File

@@ -448,9 +448,8 @@ MPP_RET mpp_meta_get_ptr(MppMeta meta, MppMetaKey key, void **val)
MppMetaImpl *impl = (MppMetaImpl *)meta;
MppMetaVal meta_val;
MPP_RET ret = get_val_by_key(impl, key, TYPE_PTR, &meta_val);
if (MPP_OK == ret)
*val = meta_val.val_ptr;
*val = (ret) ? NULL : meta_val.val_ptr;
return ret;
}
@@ -503,9 +502,8 @@ MPP_RET mpp_meta_get_frame(MppMeta meta, MppMetaKey key, MppFrame *frame)
MppMetaImpl *impl = (MppMetaImpl *)meta;
MppMetaVal meta_val;
MPP_RET ret = get_val_by_key(impl, key, TYPE_FRAME, &meta_val);
if (MPP_OK == ret)
*frame = meta_val.frame;
*frame = (ret) ? NULL : meta_val.frame;
return ret;
}
@@ -519,9 +517,8 @@ MPP_RET mpp_meta_get_packet(MppMeta meta, MppMetaKey key, MppPacket *packet)
MppMetaImpl *impl = (MppMetaImpl *)meta;
MppMetaVal meta_val;
MPP_RET ret = get_val_by_key(impl, key, TYPE_PACKET, &meta_val);
if (MPP_OK == ret)
*packet = meta_val.packet;
*packet = (ret) ? NULL : meta_val.packet;
return ret;
}
@@ -535,9 +532,8 @@ MPP_RET mpp_meta_get_buffer(MppMeta meta, MppMetaKey key, MppBuffer *buffer)
MppMetaImpl *impl = (MppMetaImpl *)meta;
MppMetaVal meta_val;
MPP_RET ret = get_val_by_key(impl, key, TYPE_BUFFER, &meta_val);
if (MPP_OK == ret)
*buffer = meta_val.buffer;
*buffer = (ret) ? NULL : meta_val.buffer;
return ret;
}