-
-
Notifications
You must be signed in to change notification settings - Fork 72
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
Basic FUNCTIONAL XMA2 support #247
Conversation
With all that being said: this still isn't perfect.
Any idea as to what could be causing that weird filter-like sound? |
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.
Functionally I'll trust that what you have works. A lot of the notes just concern compatibility with existing data/applications and some style stuff here and there.
For WMA however I'll have to defer to someone else - once everything else is finished I'll CC them in so they can check it out.
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.
Pass 2, pretty close to ready at this point.
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.
Latest looks good! Going to CC @aeikum to make sure we didn't screw up the WMA support.
Thanks for checking. Unfortunately 810ffd4 crashes both Banished and Castle Crashers for me, so looks like something is going wrong :( I've attached a log here, but it doesn't look super informative to me. The crash is on line 1669. |
In my attempt to decouple XMA2 decoding from As for the |
@aeikum can you please re-review the PR with the latest two commits? 😅 |
Awesome, thanks to both of you for checking this out! |
Compared to #66, this is no longer "initial" and it's no longer taking stupid shortcuts.
*breathes in*
gst-libav
ships withavdec_xma2
(citation needed). While we could wait for every distro under the sun to expose proper sink caps, I've taken the creative liberty to add an optionalautoplug-factories
handler with some dynamic mimetype shenanigans for that specific factory.FAudioXMA2WaveFormat
as FFmpeg currently accepts (but doesn't fully respect) XMA2 extra data.FAudioWaveFormatExtensible
. Goodbye, broken shortcuts!FAudioAnyWaveFormat
as an union of all wave formats.FAudio_CreateSourceVoice
andFAudioSourceVoice_SubmitSourceBuffer
have been modified to take multiple wave formats andFAudioBufferWMA
into account. Given how both are passed by reference and not by value anyway, I'm expecting things to end up fine. Please let me know if I'm overlooking something though, no matter how obvious.FACTWaveBank_Prepare
reconstructs as much of the XMA2 extra data as necessary and documents all the quirks I've encountered for future reference. Maybe a future replacement decoder will verify the accuracy of this.nBlockAlign
wasn't enough to feed the decoder with properly sized blocks (in part due to its 16-bit size limitation) - the GStreamer decoder now usesdwBytesPerBlock
(32-bit) when necessary.FAudio_GSTREAMER_FillConvertCache
happily read beyond the amount of encoded bytes into unknown territory. This PR changes that to feed undersized end buffers properly, but I don't know if every format expects that. Checking for the format type and handling it accordingly (return early? pad?) is out of the scope of this PR though.FACTWaveBank_GetWaveProperties
now asserts when encountering XMA2 because I've yet to encounter a game that calls it and who knows what games expect? If required, I'll follow up with an approximate implementation.*breathes out*
Some things are handled outside of this PR, namely a FACT big endian variation table fix (thanks for merging that ahead of time!) and a FNA PR which I'll follow up with soon.
By the way, this finally fixes all XMA2 bugs related to #95 which I've encountered.