Skip to content

Commit

Permalink
Increase the max sources
Browse files Browse the repository at this point in the history
Since sources are generated dynamically, there's no extra burden to allowing
more. Any cost incurred with more sources will be a result of the app having
that many non-deferred DSound buffers.
  • Loading branch information
kcat committed Mar 13, 2023
1 parent c279d5c commit 9da66f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion dsound8.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,9 @@ static HRESULT DSShare_Create(REFIID guid, DeviceShare **out)
popALContext();

hr = E_OUTOFMEMORY;
if(share->sources.maxhw_alloc < 128)
if(share->sources.maxhw_alloc > MAX_SOURCES)
share->sources.maxhw_alloc = MAX_SOURCES;
else if(share->sources.maxhw_alloc < 128)
{
ERR("Could only allocate %lu sources (minimum 128 required)\n",
share->sources.maxhw_alloc);
Expand Down
2 changes: 1 addition & 1 deletion dsound_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ enum {
*/
#define MAX_HWBUFFERS 128

#define MAX_SOURCES 512
#define MAX_SOURCES 1024
typedef struct SourceCollection {
DWORD maxhw_alloc, availhw_num;
DWORD maxsw_alloc, availsw_num;
Expand Down

0 comments on commit 9da66f8

Please sign in to comment.