aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-06-23 08:13:42 -0700
committerChris Robinson <[email protected]>2017-06-23 08:13:42 -0700
commit9d01ac440de6adfe348005622a065ebd4bd35e8f (patch)
tree4751baee00e8a7d4903b4fabdf72809f06fb5be8 /Alc
parent44a940d8d6140f142c4a88fef0281b54861e1e0c (diff)
Don't report any output samples for no input samples
Diffstat (limited to 'Alc')
-rw-r--r--Alc/converter.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Alc/converter.c b/Alc/converter.c
index 9fe76faa..ee8bb7fb 100644
--- a/Alc/converter.c
+++ b/Alc/converter.c
@@ -194,6 +194,12 @@ ALsizei SampleConverterAvailableOut(SampleConverter *converter, ALsizei srcframe
prepcount = 0;
}
+ if(srcframes < 1)
+ {
+ /* No output samples if there's no input samples. */
+ return 0;
+ }
+
if(prepcount < MAX_POST_SAMPLES+MAX_PRE_SAMPLES &&
MAX_POST_SAMPLES+MAX_PRE_SAMPLES-prepcount >= srcframes)
{