libobs: Add experimental API to retrieve next audio timestamp on source #11176
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a new API
obs_source_get_next_audio_timestamp
, which returns the timestampstruct obs_source::next_audio_ts_min
.This PR will make the PR below obsolete.
Motivation and Context
The timetamp indicates the timestamp that the the next call of
obs_source_output_audio
should provide, assuming if there is no delay in the audio filters.This should be helpful for my plugin async-audio-filter. The usage will be like this PR. Without this API, the plugin need to estimate
next_audio_ts_min
by a complicated code and still it is not always accurate.I originally hoped the PR #6351 but the PR looks stale. Instead, I suggest to just add an API and let the plugin to do the similar job of #6351.
How Has This Been Tested?
OS: Fedora 39
Tested with the modified plugin.
Types of changes
Checklist: