fix[mpeg4_api]: fix drop frame when two stream switch

There is a case:
In split mode, after sending the last packet of a stream,
the user then continues to send packet with extra data flag for the new
stream.
It will result in the last packet loss.

Change-Id: Iba945dbf4229a49fea2040ecc9f76e4ef7209de8
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
This commit is contained in:
Yandong Lin
2023-11-02 17:59:46 +08:00
committed by Herman Chen
parent 65439d38a4
commit cc20dd3efe

View File

@@ -232,6 +232,14 @@ static MPP_RET mpg4d_prepare(void *dec, MppPacket pkt, HalDecTask *task)
mpp_packet_set_size(p->task_pkt, p->stream_size);
}
if (mpp_packet_get_flag(pkt) & MPP_PACKET_FLAG_EXTRA_DATA) {
if (p->left_length > 0) {
p->left_length = 0;
task->valid = 1;
return MPP_OK;
}
}
if (!p->need_split ||
(mpp_packet_get_flag(pkt) & MPP_PACKET_FLAG_EXTRA_DATA)) {
p->got_eos = eos;