amlv4l2dec: CB2 pts of frame and decoded pts are inconsistent result error [1/1]

PD#SWPL-125538

Problem:
pts of frame and decoded pts are inconsistent, resulting in error

Solution:
When pts is invalid, enter a second loop
and assign the frame's pts as invalid

Verify:
smart-home

Signed-off-by: zengliang.li <zengliang.li@amlogic.com>
Change-Id: I3eed951b40fcf6154afb30bfb65b98000fb36b41
diff --git a/src/gstamlv4l2videodec.c b/src/gstamlv4l2videodec.c
index 99c36f6..1529012 100644
--- a/src/gstamlv4l2videodec.c
+++ b/src/gstamlv4l2videodec.c
@@ -660,14 +660,23 @@
 
         if (GST_CLOCK_TIME_IS_VALID(pts) && (ABSDIFF(f->pts,pts)) < 1000) {
             frame = f;
-        } else {
-            if (!frame || (GST_CLOCK_TIME_IS_VALID(frame->pts) && GST_CLOCK_TIME_IS_VALID(f->pts) && (frame->pts > f->pts)))
-                frame = f;
         }
-
         count++;
     }
 
+    if (!frame)
+    {
+        for (l = frames; l != NULL; l = l->next)
+        {
+            GstVideoCodecFrame *f = l->data;
+            if (!GST_CLOCK_TIME_IS_VALID(f->pts))
+            {
+                frame = f;
+            }
+            GST_DEBUG("The pts of the expected output frame is invalid");
+        }
+    }
+
     if (frame)
     {
         GST_LOG_OBJECT(decoder,