MLK-21524: VPU Decoder: tsm ignore invalid timestamp in some case
authorming_qian <ming.qian@nxp.com>
Tue, 23 Apr 2019 09:24:36 +0000 (17:24 +0800)
committerming_qian <ming.qian@nxp.com>
Wed, 24 Apr 2019 02:58:08 +0000 (10:58 +0800)
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 <ming.qian@nxp.com>
drivers/mxc/vpu_malone/vpu_ts.c

index ecdff4f..1c37fc8 100644 (file)
@@ -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),