diff options
author | Chris Robinson <[email protected]> | 2017-06-23 08:13:42 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-06-23 08:13:42 -0700 |
commit | 9d01ac440de6adfe348005622a065ebd4bd35e8f (patch) | |
tree | 4751baee00e8a7d4903b4fabdf72809f06fb5be8 /Alc/converter.c | |
parent | 44a940d8d6140f142c4a88fef0281b54861e1e0c (diff) |
Don't report any output samples for no input samples
Diffstat (limited to 'Alc/converter.c')
-rw-r--r-- | Alc/converter.c | 6 |
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) { |