videorate: fix assertion when pushing last and only buffer without duration
authorGuillaume Desmottes <guillaume.desmottes@onestream.live>
Tue, 26 Apr 2022 08:58:08 +0000 (10:58 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 26 Apr 2022 13:43:56 +0000 (13:43 +0000)
commitc0d7d5c2c8d2934004d99eaf2c67b90cde349663
treeaabd22b2cda8a0fff626e81f97b1460df87d43cd
parent264e577e7efa9f2fef5cfbf88e45279aac166141
videorate: fix assertion when pushing last and only buffer without duration

Fixing this pipeline:
  gst-launch-1.0 filesrc location=sample.png ! pngdec ! videorate ! fakesink

- videorate receives a single buffer with pts = 0, duration = invalid;
- then it receives eos triggering this buffer to be pushed downstream;
- the pushing code was assuming that a duration was set, which is
  impossible as we received a single buffer and no output framerate was
  set either. So the best we can do is to push the buffer without
  duration.

Fix #1177

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2296>
subprojects/gst-plugins-base/gst/videorate/gstvideorate.c