Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions PATCHES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Local Patches

This fork (`groundhog-audio/rtaudio`) carries the following deviations from
upstream `thestk/rtaudio`:

## Fix ghost ASIO driver hang by validating HFILE properly

**File:** `include/asiolist.cpp`

The bundled ASIO SDK shim used `if (hfile)` to validate the result of the
Win16 `OpenFile()` API. `OpenFile` returns `HFILE_ERROR` (`-1`) on failure,
which is truthy, so ghost/invalid ASIO driver registry entries (left behind
by uninstalled audio software) passed the check and caused
`loadAsioDriver` to hang the application indefinitely during device
enumeration. Changed to `if (hfile && hfile != HFILE_ERROR)` to reject both
sentinels explicitly (matches the documented Win16 API contract).
4 changes: 2 additions & 2 deletions include/asiolist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static LONG findDrvPath (char *clsidstr,char *dllpath,int dllpathsize)
memset(&ofs,0,sizeof(OFSTRUCT));
ofs.cBytes = sizeof(OFSTRUCT);
hfile = OpenFile(dllpath,&ofs,OF_EXIST);
if (hfile) rc = 0;
if (hfile && hfile != HFILE_ERROR) rc = 0;
}
RegCloseKey(hkpath);
}
Expand Down Expand Up @@ -69,7 +69,7 @@ static LONG findDrvPath (char *clsidstr,char *dllpath,int dllpathsize)
memset(&ofs,0,sizeof(OFSTRUCT));
ofs.cBytes = sizeof(OFSTRUCT);
hfile = OpenFile(dllpath,&ofs,OF_EXIST);
if (hfile) rc = 0;
if (hfile && hfile != HFILE_ERROR) rc = 0;
}
RegCloseKey(hkpath);
}
Expand Down
Loading