v4l2videodec: AV unsync for streams with many frames that cannot be decoded
Describe your issue
AV unsync:
When playing streams with lots of frames decoded with V4L2_BUF_FLAG_ERROR, CAPTURE buffers' timestamps may be smaller than real pts. It seems like video play faster than audio.
Currently, v4l2videodec drops frames only when system_frame_number is too old (absdiff > 100). If some frames cannot be decoded and dequeued buffer has flag V4L2_BUF_FLAG_ERROR, these frames' timestamps still participate in sorting.
However in fact, these frames' timestamp should be dropped immediately and not involved in sorting.
Setup
- Operating System: Linux imx8mqevk
- Device: imx8mqevk
- GStreamer Version: 1.22.5
@nicolas, do you have any opinion on this ?