[mpg4d]: fix hiding bugs when split mode

1. task_length must use total length to charge whether realloc
2. when packet is the eos, the lastest packet finished

Change-Id: I29a8b9f61a57516bd85fd243616036bdcfade856
Signed-off-by: leo.ding <leo.ding@rock-chips.com>
This commit is contained in:
leo.ding 2017-10-09 17:25:55 +08:00 committed by Herman Chen
parent 48f231c8a1
commit 842b26d850
2 changed files with 3 additions and 3 deletions

View file

@ -218,11 +218,10 @@ static MPP_RET mpg4d_prepare(void *dec, MppPacket pkt, HalDecTask *task)
size_t total_length = MPP_ALIGN(p->left_length + length, 16) + 64; // add extra 64 bytes in tails
if (total_length > p->stream_size) {
RK_U8 *dst;
RK_U8 *dst = NULL;
do {
p->stream_size <<= 1;
} while (length > p->stream_size);
} while (total_length > p->stream_size);
dst = mpp_malloc_size(RK_U8, p->stream_size);
mpp_assert(dst);

View file

@ -1217,6 +1217,7 @@ MPP_RET mpp_mpg4_parser_split(Mpg4dParser ctx, MppPacket dst, MppPacket src)
// the last packet
if (src_eos && src_pos >= src_len) {
mpp_packet_set_eos(dst);
ret = MPP_OK;
}
// reset the src and dst
mpp_packet_set_length(dst, dst_len);