-
-
Notifications
You must be signed in to change notification settings - Fork 370
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
Pre-configured decoding calls have their result
overwritten
#899
Comments
Thanks. I'm going to sit on this for the moment. In the dev-0.12 branch I've actually done a complete overhaul of the decoding backend selection logic and I'm not sure off the top of my head if what you've mentioned still applies. But I'm also not sure if I agree with your suggestions just yet and want to consider it. If you're curious, here's my comment on the changes in dev-0.12: #765 (comment) |
Thanks for the quick response!
Sounds good - as long as you're aware of this. 🙂
*(If this behavior is intended behavior or can't be reproduced in the `dev`
branch, feel free to close this issue.)*
|
So I've taken a look at what I'm doing in the dev-0.12 branch and it was indeed overwriting the result code and returning This is the change I made in case it might be of interest to you: 69df19f |
Summary
When
ma_decoder_init_file
is provided adecoderConfig
with a specificencodingFormat
, the "fallback" decoding calls can overwrite theresult
value from the initial specific-format decoding call.Example Scenario
Call
ma_decoder_init_file
with a preconfiguredencodingFormat
and a bad filepath as shown below:What happens
MA_INVALID_FILE
error code.MA_NO_BACKEND
.In the end,
decoderInitResult
resolves toMA_NO_BACKEND
.What should happen
Ideally, the
MA_INVALID_FILE
error would not have been overwritten!Potential fixes
1) Log format-specific errors
Log the initial error code (in this case,
MA_INVALID_FILE
) and return the error code from the fallback decoding calls.2) Preserve format-specific error codes
Preserve (and return) the initial error code while still performing the fallback decoding calls.
Of these two options, my preference is for the second.
Next steps
@mackron if you're on board with this, let me know:
Thank you! 😃
The text was updated successfully, but these errors were encountered: