mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-09 02:50:06 +08:00
[m2vd_parser]: fix wrong frame period cause PTS predict error
When the frame period changes, it will be recorded in the last frame period first, but this value is an error value, which cannot be updated back to the correct frame period later, so the correct frame period should be restored at this time. Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com> Change-Id: I4b910efb0145b665ff664a552517ffa0ff920ba5
This commit is contained in:
@@ -1177,10 +1177,14 @@ static MPP_RET m2vd_alloc_frame(M2VDParserContext *ctx)
|
||||
tmp_frame_period = (tmp_frame_period * 256) / ctx->GroupFrameCnt;
|
||||
if ((tmp_frame_period > 4200) && (tmp_frame_period < 11200) &&
|
||||
(fabs(ctx->frame_period - tmp_frame_period) > 128)) {
|
||||
if (fabs(ctx->preframe_period - tmp_frame_period) > 128)
|
||||
if (fabs(ctx->preframe_period - tmp_frame_period) > 128) {
|
||||
ctx->preframe_period = tmp_frame_period;
|
||||
else
|
||||
} else {
|
||||
ctx->frame_period = tmp_frame_period;
|
||||
ctx->preframe_period = 0;
|
||||
}
|
||||
} else {
|
||||
ctx->preframe_period = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user