8000 Update AppMidiManager.cpp by sensn · Pull Request #1101 · android/ndk-samples · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Update AppMidiManager.cpp #1101

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

Merged
merged 2 commits into from
Jun 25, 2025
Merged

Update AppMidiManager.cpp #1101

merged 2 commits into from
Jun 25, 2025

Conversation

sensn
Copy link
Contributor
@sensn sensn commented Jun 18, 2025

When switching MidiDevices the InputPort needs to be closed first, otherwise the new selected MidiDevice doesn't receive any Messages. This is at least the case on my android Device.

AMidiInputPort_close(sMidiInputPort);

8000
When switching MidiDevices the InputPort needs to be closed first, otherwise the new selected MidiDevice doesn't receive any Messages. This is at least the case on my android Device.

AMidiInputPort_close(sMidiInputPort);
Copy link
google-cla bot commented Jun 18, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Member
@DanAlbert DanAlbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of the code around this looks suspect to me because there's no error checking, so this may attempt to close a thing that wasn't successfully opened... but that's all pre-existing, and this definitely fixes one of the problems. If the rest of the sample looks anything like these two functions, this sample is probably due for a pretty significant overhaul :(

Thanks for the PR! Will merge, but I can't until you've signed the CLA.

add nullptr-check to AMidiInputPort_close()
@DanAlbert DanAlbert enabled auto-merge (squash) June 25, 2025 19:11
@DanAlbert DanAlbert merged commit 6ed897d into android:main Jun 25, 2025
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants
0