msdkdec: align frame list using decoded timestamp
authorJosep Torra <jtorra@oblong.com>
Wed, 6 Nov 2019 12:45:09 +0000 (04:45 -0800)
committerHaihao Xiang <haihao.xiang@intel.com>
Sun, 19 Jan 2020 04:26:15 +0000 (04:26 +0000)
commitef3744646046cf77a01a6f99c80488daa802dd69
tree284eafaca0f9315d45acff27dda53cfbe39ad063
parente8d527df939f0c2c1a004786fee961228fb82586
msdkdec: align frame list using decoded timestamp

Before this change decoder used the oldest frame in the list to pair it
with the decoded surface. This only works when there's a perfect stream
like HEADERS,SYNCPOINT,DELTA...

When playing RTSP streams we can get imperfect streams like HEADERS,
DELTA,SYNCPOINT,DELTA... In this case decoder drops the frames
between HEADERS and SYNCPOINT which leads into using wrong PTS on
the output frames.

With this change we inject the input PTS into the bitstream and use it
to align the internal frame list with the actually decoded position.

Fixes playback with:
```
gst-launch-1.0 rtspsrc location=... latency=0 drop-on-latency=1 ! ...
```
sys/msdk/gstmsdkdec.c