libs: audio: Handle meta changes in gst_audio_buffer_truncate
authorVivia Nikolaidou <vivia@ahiru.eu>
Wed, 17 Feb 2021 10:41:06 +0000 (12:41 +0200)
committerVivia Nikolaidou <vivia@ahiru.eu>
Thu, 18 Feb 2021 09:25:32 +0000 (11:25 +0200)
commit2527c8f9f8eca9b19014ba7b442ae4becbe45eac
tree8a7c2085ff27f192ade0c46883e81a534c6907ad
parentc7f1fd832057f9bc7c3cd0724d47d98ed0a03a91
libs: audio: Handle meta changes in gst_audio_buffer_truncate

Set timestamp and duration to GST_CLOCK_TIME_NONE unless trim==0,
because that function doesn't know the rate and therefore can't
calculate them. Set offset and offset_end to appropriate values. Make it
clear in the documentation that the caller is responsible for setting
the timestamp and duration.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/869

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1039>
gst-libs/gst/audio/audio.c
tests/check/libs/audio.c