-
Notifications
You must be signed in to change notification settings - Fork 516
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
[src] Added manual binding to prevent issue of AVAudioPlayer FromData() and FromUrl() throwing exceptions. #17073
[src] Added manual binding to prevent issue of AVAudioPlayer FromData() and FromUrl() throwing exceptions. #17073
Conversation
…zeHandle from throwing exception.
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a few test cases here would also be nice:
…y call obj_send in AVAudioPlayer
Tests are a little wonky for me locally because I'm having provisioning errors. So tests will probably need to be adjusted. |
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ API diff for current PR / commitLegacy Xamarin (No breaking changes)
NET (empty diffs)
✅ API diff vs stableLegacy Xamarin (No breaking changes).NET (No breaking changes)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
💻 [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) passed 💻✅ All tests on macOS M1 - Mac Big Sur (11.5) passed. Pipeline on Agent |
🚀 [CI Build] Test results 🚀Test results✅ All tests passed on VSTS: simulator tests. 🎉 All 225 tests passed 🎉 Tests counts✅ bcl: All 69 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great!
…() and FromUrl() throwing exceptions. (#17073) Provided manual binding of AVAudioPlayer::initWithContentsOfURL:error: and AVAudioPlayer::initWithData:error: to prevent an issue where AVAudioPlayer::FromData() and FromUrl() do not throw exceptions when returning null. Fixes #16229 Co-authored-by: GitHub Actions Autoformatter <[email protected]>
Was able to reproduce issue by creating a new Xamarin project and using an invalid NURL like in the issue. What happens is an exception is thrown by InitializeHandle (line 631 of NSObject2.cs) because the handle passed to it is null. I am unsure about this, but wonder if GetHandle's return of only an IntPtr instead of NativeHandle (in Selector.cs) is somehow causing an issue.
The desired behavior by user was to not have an exception thrown but to return null and assign the error to the out NSError parameter. The error code seems, on a quick Google search, with being unable to access a specified file.
"error {The operation couldn’t be completed. (OSStatus error 2003334207.)}"
Trivia: apparently that error code is a 4 character ASCII for "wht?"
I'm not sure if additional work needs to be done to the binding itself, since the user also indicated that this exception was thrown even with a valid NSURL.
I also adjusted the other methods in this class to have try/catch as well, in case this issue popped up again.
Fixes #16229