rtpmp4gdepay: Set duration on outgoing buffers

If we have constant duration buffers, set the duration on
outgoing buffers, like rtpmp4adepay does. This fixes
problems with (for example) muxers like mp4mux not writing
the duration of the final sample into the index.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6878>
This commit is contained in:
Jan Schmidt 2024-05-18 01:24:44 +10:00 committed by GStreamer Marge Bot
parent b8a8eacdb2
commit 64133b40a7

View file

@ -717,6 +717,9 @@ gst_rtp_mp4g_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
* in this RTP packet. */
timestamp += (rtpmp4gdepay->constantDuration * GST_SECOND) /
depayload->clock_rate;
/* Set the duration for the outgoing buffer */
GST_BUFFER_DURATION (outbuf) = timestamp - GST_BUFFER_PTS (outbuf);
} else {
/* otherwise, make sure we don't use the timestamp again for other
* AUs. */