Skip to content

Fix #1156 Crackling sound when cutting pcm_s24le in mkv#1188

Merged
ddennedy merged 1 commit into
masterfrom
audio_artifact
Dec 20, 2025
Merged

Fix #1156 Crackling sound when cutting pcm_s24le in mkv#1188
ddennedy merged 1 commit into
masterfrom
audio_artifact

Conversation

@bmatherly

Copy link
Copy Markdown
Member

For the provided test clip, Libav provides an audio timebase of 1000 ticks per second for the PTS. However, the sample rate is 48000 samples per second. That means each pts tick represents 48 audio samples. The PTS calculation is drived from muliple calculations including the profile frame rate. Those calculations create opportunities for rounding errors in the sample calculation. In this case, after an initial synchornization, the PTS calculation still would occasionally find an offset of 1 tick.

This change essentially changes the synchronization to not take action unless the offset is greater than 1 tick. When it does take action to synchronize, it uses all the precision that it has.

For the provided test clip, Libav provides an audio timebase of
1000 ticks per second for the PTS. However, the sample rate is
48000 samples per second. That means each pts tick represents 48
audio samples. The PTS calculation is drived from muliple
calculations including the profile frame rate. Those calculations
create opportunities for rounding errors in the sample calculation.
In this case, after an initial synchornization, the PTS calculation
still would occasionally find an offset of 1 tick.

This change essentially changes the synchronization to not take
action unless the offset is greater than 1 tick. When it does take
action to synchronize, it uses all the precision that it has.
@ddennedy ddennedy added this to the v7.36.0 milestone Dec 20, 2025
@ddennedy ddennedy merged commit b842860 into master Dec 20, 2025
21 checks passed
@ddennedy ddennedy deleted the audio_artifact branch December 20, 2025 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants