mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-05 17:16:50 +08:00
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:
@@ -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);
|
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 ||
|
if (!p->need_split ||
|
||||||
(mpp_packet_get_flag(pkt) & MPP_PACKET_FLAG_EXTRA_DATA)) {
|
(mpp_packet_get_flag(pkt) & MPP_PACKET_FLAG_EXTRA_DATA)) {
|
||||||
p->got_eos = eos;
|
p->got_eos = eos;
|
||||||
|
Reference in New Issue
Block a user