Skip to content

Conversation

@derrod
Copy link
Member

@derrod derrod commented May 18, 2024

Description

Only set audio offset if current DTS is positive.

Motivation and Context

DTS/PTS can be negative for "priming" samples produced by AAC/Opus encoders, currently this would result in the DTS/PTS being corrected to 0, which causes A/V desync by making the silent priming samples part of the actual presentation.

By leaving the negative DTS/PTS the FFmpeg muxer (and #10608) can correctly set the encoder delay and ensure synced playback.

How Has This Been Tested?

Recorded a few videos of the Twitch sync test and validated that sync is now equivalent to PCM (there still seems to be one frame of delay somewhere in OBS).

Resolve Comparison

(Note: #10690 was included here)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@Lain-B Lain-B merged commit adf744e into obsproject:master May 18, 2024
@RytoEX RytoEX added this to the OBS Studio (Next Version) milestone May 18, 2024
@derrod derrod deleted the fix-audio-dts-offset branch May 18, 2024 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Fix Non-breaking change which fixes an issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants