Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
plugin-GUI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
yehaojie
plugin-GUI
Commits
2169872e
Commit
2169872e
authored
10 years ago
by
Josh Siegle
Browse files
Options
Downloads
Patches
Plain Diff
Add check for buffer overrun in AudioNode
parent
13650eea
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Builds/VisualStudio2012/open-ephys.vcxproj
+1
-1
1 addition, 1 deletion
Builds/VisualStudio2012/open-ephys.vcxproj
Source/Processors/AudioNode.cpp
+6
-2
6 additions, 2 deletions
Source/Processors/AudioNode.cpp
with
7 additions
and
3 deletions
Builds/VisualStudio2012/open-ephys.vcxproj
+
1
−
1
View file @
2169872e
...
...
@@ -96,7 +96,7 @@
<ProgramDataBaseFileName>
$(IntDir)\
</ProgramDataBaseFileName>
<WarningLevel>
Level4
</WarningLevel>
<SuppressStartupBanner>
true
</SuppressStartupBanner>
<MultiProcessorCompilation>
tru
e
</MultiProcessorCompilation>
<MultiProcessorCompilation>
fals
e
</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>
_DEBUG;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
...
...
This diff is collapsed.
Click to expand it.
Source/Processors/AudioNode.cpp
+
6
−
2
View file @
2169872e
...
...
@@ -336,7 +336,7 @@ void AudioNode::process(AudioSampleBuffer& buffer,
// std::cout << "Samples remaining in incoming buffer: " << orphanedSamples << std::endl;
if
(
orphanedSamples
>
0
)
if
(
orphanedSamples
>
0
&&
(
samplesInBackupBuffer
+
orphanedSamples
<
backupBuffer
->
getNumSamples
())
)
{
backupBuffer
->
addFrom
(
0
,
// destination channel
samplesInBackupBuffer
,
// destination start sample
...
...
@@ -356,7 +356,11 @@ void AudioNode::process(AudioSampleBuffer& buffer,
gain
// gain to apply
);
}
}
else
{
samplesInBackupBuffer
=
0
;
// just throw out the buffer in the case of an overrun
// not ideal, but the output still sounds fine
}
// Simple implementation of a "noise gate" on audio output
expander
.
process
(
buffer
.
getWritePointer
(
0
),
// left channel
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment