From: ming_qian Date: Tue, 23 Apr 2019 09:24:36 +0000 (+0800) Subject: MLK-21524: VPU Decoder: tsm ignore invalid timestamp in some case X-Git-Tag: rel_imx_4.19.35_1.1.0~680 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=be4ba211d259781211f74710a9d19c9a4607ea7a;p=linux.git MLK-21524: VPU Decoder: tsm ignore invalid timestamp in some case If one frame is split into several buffers. The timestamp of the first buffer is valid, others are invalid. TSManagerGetLastTimeStamp() will try to get the last timestamp of frame. it may get a invalid timestamp. and this will output some wrong timestamp. so ignore these invalid timestamp Signed-off-by: ming_qian --- diff --git a/drivers/mxc/vpu_malone/vpu_ts.c b/drivers/mxc/vpu_malone/vpu_ts.c index ecdff4f6be31..1c37fc83c884 100644 --- a/drivers/mxc/vpu_malone/vpu_ts.c +++ b/drivers/mxc/vpu_malone/vpu_ts.c @@ -109,7 +109,8 @@ static TSM_TIMESTAMP TSManagerGetLastTimeStamp(TSMRecivedCtl *rctl, TSMReceivedEntry *e; while ((size > 0) && (e = rctl->head)) { - ts = ((e->used) ? (TSM_TIMESTAMP_NONE) : (e->ts)); + if (TSM_TS_IS_VALID(e->ts)) + ts = ((e->used) ? (TSM_TIMESTAMP_NONE) : (e->ts)); TSM_VERBOSE("ts get: %u:%02u:%02u.%09u\n", TSM_TIME_H(ts),