[mpp]: Fix compiling error on Linux

Issue: https://github.com/rockchip-linux/mpp/issues/48

Change-Id: I08bc75a4cab23d4b96c6bac3b671e50edbff55fb
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
Herman Chen
2018-08-07 08:45:48 +08:00
parent 76b8c229a2
commit b81b3e52cd
4 changed files with 5 additions and 4 deletions

View File

@@ -162,7 +162,7 @@ MPP_RET dummy_dec_prepare(void *dec, MppPacket pkt, HalDecTask *task)
data = mpp_packet_get_data(pkt); data = mpp_packet_get_data(pkt);
length = mpp_packet_get_length(pkt); length = mpp_packet_get_length(pkt);
if (length > p->stream_size) { if (length > p->stream_size) {
mpp_realloc(p->stream, RK_U8, length); p->stream = mpp_realloc(p->stream, RK_U8, length);
mpp_packet_set_data(p->task_pkt, p->stream); mpp_packet_set_data(p->task_pkt, p->stream);
p->stream_size = length; p->stream_size = length;
} }

View File

@@ -109,8 +109,7 @@ static RK_S32 mpp_device_get_client_type(MppDevCtx ctx, MppCtxType type, MppCodi
RK_S32 client_type = -1; RK_S32 client_type = -1;
MppDevCtxImpl *p; MppDevCtxImpl *p;
if (NULL == ctx || if (NULL == ctx || type >= MPP_CTX_BUTT ||
(type >= MPP_CTX_BUTT || type < 0) ||
(coding >= MPP_VIDEO_CodingMax || coding <= MPP_VIDEO_CodingUnused)) { (coding >= MPP_VIDEO_CodingMax || coding <= MPP_VIDEO_CodingUnused)) {
mpp_err_f("found NULL input ctx %p coding %d type %d\n", ctx, coding, type); mpp_err_f("found NULL input ctx %p coding %d type %d\n", ctx, coding, type);
return MPP_ERR_NULL_PTR; return MPP_ERR_NULL_PTR;

View File

@@ -17,6 +17,8 @@
#define MODULE_TAG "mpp_impl" #define MODULE_TAG "mpp_impl"
#include <string.h>
#include "mpp_mem.h" #include "mpp_mem.h"
#include "mpp_env.h" #include "mpp_env.h"
#include "mpp_common.h" #include "mpp_common.h"

View File

@@ -78,7 +78,7 @@ MppTimer mpp_timer_get(const char *name)
MppTimerImpl *impl = mpp_calloc(MppTimerImpl, 1); MppTimerImpl *impl = mpp_calloc(MppTimerImpl, 1);
if (impl) { if (impl) {
impl->check = module_name; impl->check = module_name;
snprintf(impl->name, sizeof(impl->name), name); snprintf(impl->name, sizeof(impl->name), name, NULL);
} else } else
mpp_err_f("malloc failed\n"); mpp_err_f("malloc failed\n");