-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Fix random audio dropouts and corruption of audio data (2/2) #5993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
floele
wants to merge
2
commits into
obsproject:master
Choose a base branch
from
floele:fix-audio-v27
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -471,6 +471,7 @@ bool audio_callback(void *param, uint64_t start_ts_in, uint64_t end_ts_in, | |
| struct ts_info ts = {start_ts_in, end_ts_in}; | ||
| size_t audio_size; | ||
| uint64_t min_ts; | ||
| bool audio_pending = false; | ||
|
|
||
| da_resize(audio->render_order, 0); | ||
| da_resize(audio->root_nodes, 0); | ||
|
|
@@ -516,6 +517,9 @@ bool audio_callback(void *param, uint64_t start_ts_in, uint64_t end_ts_in, | |
| obs_source_audio_render(source, mixers, channels, sample_rate, | ||
| audio_size); | ||
|
|
||
| if (source->audio_pending && source->audio_ts) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While chasing a different audio bug, I found that the changes in this file appear to negatively affect A-V sync for some jittery sources. Due to the nature of how difficult it is to reproduce this bug, I am unable to practically investigate any further. |
||
| audio_pending = true; | ||
|
|
||
| /* if a source has gone backward in time and we can no | ||
| * longer buffer, drop some or all of its audio */ | ||
| if (audio->total_buffering_ticks == MAX_BUFFERING_TICKS && | ||
|
|
@@ -611,5 +615,5 @@ bool audio_callback(void *param, uint64_t start_ts_in, uint64_t end_ts_in, | |
| execute_audio_tasks(); | ||
|
|
||
| UNUSED_PARAMETER(param); | ||
| return true; | ||
| return !audio_pending; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't fully understand the purpose of these changes here:
input_and_outputto check if the expected number of samples were provided by the audio sourcewait_cycles(should be1before the next iteration)wait_cyclesagain (it should be0then).As such it only seems to wait for half a circle to increment and decrement a single variable that otherwise has no impact on the code executed in the loop. Or am I missing something?