mpegvideoparse: do not set delta unit flag on unknown frame type
authorThéo Maillart <tmaillart@freebox.fr>
Tue, 5 Nov 2024 13:34:03 +0000 (14:34 +0100)
committerBackport Bot <gitlab-backport-bot@gstreamer-foundation.org>
Tue, 12 Nov 2024 16:30:26 +0000 (16:30 +0000)
commit81f2488f207c1b58b1a4c5411831a419c10da2d6
tree9646cec5a1aa829c26f9796bc04c9ade56f60d03
parentf10c800b8e7d63062a5e9676da49b8bdce2d2621
mpegvideoparse: do not set delta unit flag on unknown frame type

When encoding an image to mpeg2 video, with something like:
  gst-launch-1.0 encodebin name=e profile=mpegpsmux:video/mpeg,mpegversion=2,systemstream=false ! \
                 filesink location=sample.mpg filesrc num-buffers=1 blocksize=$(stat -c%s sample.png) \
                 location=sample/dts.png ! pngdec ! e.
The only frame's type is set to an invalid value 0
The consequence is that mpegvideoparse sets the delta unit flag on the buffer because
it is not an I frame, then decodebin3 drops this only frame because the delta
unit flag is set and the decoder receives eos before it was able to receive any
encoded data

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7876>
subprojects/gst-plugins-bad/gst/videoparsers/gstmpegvideoparse.c