From d373cd08152a889ec3fecab269efcc2b0ad5b6fc Mon Sep 17 00:00:00 2001 From: Romain Beauxis Date: Wed, 7 Feb 2024 22:32:18 -0600 Subject: [PATCH] Update 2024-02-07-liquidsoap-v2.2.4.md --- _posts/2024-02-07-liquidsoap-v2.2.4.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/_posts/2024-02-07-liquidsoap-v2.2.4.md b/_posts/2024-02-07-liquidsoap-v2.2.4.md index 7e33924fbec2..f7d3af17e52b 100644 --- a/_posts/2024-02-07-liquidsoap-v2.2.4.md +++ b/_posts/2024-02-07-liquidsoap-v2.2.4.md @@ -63,7 +63,10 @@ flexibility to those. But, first, let's have a look at how crossfade work: * When detecting that the track has ended, liquidsoap has a certain amount of data buffered from the ending track. This is usually close to `cross_duration`. Let's call this value `buffered_before`. * Next, liquidsoap buffers some data from the starting track. This will be as close as possible to `buffered_before` but can be slightly different. It can also be much less if the track is too short. Let's call this value `buffered_after`. * ⚠️ **Note** ⚠️ : A new track that is shorter than `cross_duration` should be considered a programming error. In particular, all its data will be consumed when computing its `fade.in` transition and no data will be available to compute its `fade.out` transition! -* Temporary sources are then created using `buffered_before` and `buffered_after` data. These sources are passed to the transition function and its result is injected between the ending and starting track, becoming the actual crossfade transition. +* If `buffered_before` and `buffered_after` differ, the extra data is stashed. Let's call the common section `common_buffer`. +* Temporary sources are then created using `common_buffer` of data from the ending and starting track. These sources are passed to the transition function. The remaining extra data is added at the begiginning or end (depending on the situation) of the result of this function and the whole source is injected between the ending and starting track, becoming the actual crossfade transition. + +Screenshot 2024-02-07 at 10 28 48 PM It is important to keep this in mind when considering the right crossfade parameters to use. In particular, as seen above, `cross_duration` should never exceed the next track's duration. This is a little tricky to enforce since `cross_duration` is set at the beginning of the ending track when it might not yet been known which