qtmux: Add durations to raw audio buffers from the raw audio adapter in prefill mode

This ensures that a duration can also be calculated and stored for the
last buffer at EOS.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3321>
This commit is contained in:
Sebastian Dröge 2022-11-04 11:10:52 +02:00 committed by GStreamer Marge Bot
parent 7b60e48c8c
commit b368a5fcd2

View file

@ -2695,7 +2695,8 @@ prefill_raw_audio_prepare_buf_func (GstQTMuxPad * qtpad, GstBuffer * buf,
qtpad->sample_size : gst_adapter_available (qtpad->raw_audio_adapter));
GST_BUFFER_PTS (buf) = input_timestamp;
GST_BUFFER_DTS (buf) = GST_CLOCK_TIME_NONE;
GST_BUFFER_DURATION (buf) = GST_CLOCK_TIME_NONE;
GST_BUFFER_DURATION (buf) = gst_util_uint64_scale (nsamples, GST_SECOND,
atom_trak_get_timescale (qtpad->trak));
qtpad->raw_audio_adapter_offset += nsamples;