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

Loop back the Atrac sound when decode fail in _AtracDecodeData #5

Closed
wants to merge 2 commits into from

Conversation

sum2012
Copy link

@sum2012 sum2012 commented Mar 23, 2015

@sum2012 sum2012 changed the title Loop back first sample when decode fail in _AtracDecodeData Loop back the Atrac sound when decode fail in _AtracDecodeData Mar 23, 2015
@daniel229
Copy link

Good,it fixes hang issue in Silverfall.

@unknownbrackets
Copy link
Owner

What if, instead, we change this part?

                    if (res == ATDECODE_FAILED) {
                        // Avoid getting stuck in a loop (Virtua Tennis)
                        *SamplesNum = 0;
                        *finish = 1;
                        *remains = 0;
                        return ATRAC_ERROR_ALL_DATA_DECODED;
                    }

Really, it shouldn't be failing, but the above may not be the most ideal thing to do if it does fail. Above it just claims that the audio ended immediately.

Also, maybe failedDecode is causing problems, as I see you set it to false. What changes if you comment out failedDecode = true;?

-[Unknown]

@sum2012
Copy link
Author

sum2012 commented Mar 26, 2015

The first change sound become noise
The second change ,audio cannot decode in the bike

@sum2012
Copy link
Author

sum2012 commented Mar 26, 2015

Some games don't expect ATRAC_ERROR_ALL_DATA_DECODED.
Moreover I think that it has sound memory problem as I need loop back the atrac to work correctly.

@unknownbrackets
Copy link
Owner

Does hrydgard#7635 take care of it?

I'd like to make it actually handle invalid data in the same way as the PSP firmware does, which I have not tested yet. I doubt that it starts over though (or stops decoding at all e.g. like failedDecode does.)

-[Unknown]

@daniel229
Copy link

hrydgard#7635 won't take care of Gripshift and Silverfall,But take care of GTA.
@sum2012 this pr causes some games(like puyopuyo fever) looping in a sound instead of silent.

@sum2012
Copy link
Author

sum2012 commented Mar 27, 2015

@daniel229 Thanks help me testing.

@sum2012 sum2012 deleted the atrac-minor- branch October 25, 2015 08:26
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.

3 participants