[m2vd]: revise predict mpeg2 pts when error detection

when preframe_period is zero use frame_period instead

Change-Id: Id1b706bd01eeb4bce4da1bf564c9197b120aef11
Signed-off-by: linyuhui <james.lin@rock-chips.com>
This commit is contained in:
linyuhui
2016-11-21 11:46:07 +08:00
parent 77bb910876
commit 2bc8bb5daa

View File

@@ -1053,7 +1053,8 @@ MPP_RET m2vd_alloc_frame(M2VDParserContext *ctx)
if ((pts > ctx->PreGetFrameTime) && (ctx->pic_head.temporal_reference > (RK_S32)ctx->PreChangeTime_index)) { if ((pts > ctx->PreGetFrameTime) && (ctx->pic_head.temporal_reference > (RK_S32)ctx->PreChangeTime_index)) {
RK_S32 theshold_frame_period = tmp_frame_period * 2 ; RK_S32 theshold_frame_period = tmp_frame_period * 2 ;
RK_S32 predict_frame_period = (ctx->pic_head.temporal_reference - ctx->PreChangeTime_index) * ctx->preframe_period / 256; RK_S32 last_frame_period = ctx->preframe_period ? ctx->preframe_period : ctx->frame_period;
RK_S32 predict_frame_period = (ctx->pic_head.temporal_reference - ctx->PreChangeTime_index) * last_frame_period / 256;
if (theshold_frame_period < predict_frame_period) { if (theshold_frame_period < predict_frame_period) {
pts = ctx->PreGetFrameTime + predict_frame_period; pts = ctx->PreGetFrameTime + predict_frame_period;
tmp_frame_period = predict_frame_period; tmp_frame_period = predict_frame_period;