But with this GStreamer pipeline
gst-launch filesrc location=$1 ! TIViddec2 engineName=&quot;decode&quot;
codecName=&quot;mpeg2dec&quot; frameRate=30 ! TIDmaiVideoSink
displayDevice=/dev/video2 displayStd=v4l2
gst-launch does not exit at the end of the clip.

The last gst-message I get is
New clock: GstSystemClock
video plays until the end of the clip and then it hangs.

This is not the case with DVSDK ./decode demo on DaVinci 6446.

This is not a general issue. There are clips, which don't show this problem.

But with this GStreamer pipeline
gst-launch filesrc location=$1 ! TIViddec2 engineName=&quot;decode&quot;
codecName=&quot;mpeg2dec&quot; frameRate=30 ! TIDmaiVideoSink
displayDevice=/dev/video2 displayStd=v4l2
gst-launch does not exit at the end of the clip.

The last gst-message I get is
New clock: GstSystemClock
video plays until the end of the clip and then it hangs.

This is not the case with DVSDK ./decode demo on DaVinci 6446.

This is not a general issue. There are clips, which don't show this problem.

2) When we get to the very end of the buffered data, we get garbage. We reach
the point where there are 2 bytes left in the buffer, but since we are draining
the buffer we call the video decoder anyway, assuming there is a complete frame
in the buffer (which there isn't):