Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loopback-capture project: the test on flags returned from IAudioCaptureClient::GetBuffer seems incorrect #100

Open
smourier opened this issue Feb 7, 2018 · 0 comments

Comments

@smourier
Copy link

smourier commented Feb 7, 2018

You do this:

if (bFirstPacket && AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY == dwFlags) {
            LOG(L"%s", L"Probably spurious glitch reported on first packet");
        } else if (0 != dwFlags) {
            LOG(L"IAudioCaptureClient::GetBuffer set flags to 0x%08x on pass %u after %u frames", dwFlags, nPasses, *pnFrames);
            return E_UNEXPECTED;
        }

On my PC I systematically receive a combination of AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY and AUDCLNT_BUFFERFLAGS_SILENT on the 1st packet so the code will return E_UNEXPECTED and I don't see why it should.

I think you should just test for AUDCLNT_BUFFERFLAGS_TIMESTAMP_ERROR (maybe? can't we just continue even on this error?) and don't care about the other flags? At least it works for me with these changes.

PS: There's another glitch with the keyboard test: if I run the app from a console, it exits immediately. I had to change the stdin test events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant