Commit Graph

131 Commits

Author SHA1 Message Date
Unknown W. Brackets e4d2712897 Mp3: Apply offset to stream read buffer.
Handle errors for sceMp3CheckStreamDataNeeded as well.
2019-04-23 21:14:54 -07:00
Unknown W. Brackets f1eaf9dc0e Mp3: Don't change buffer accounting until add.
If we just ask what we should add, that is meant to stay static until we
do actually add it.

This also reduces the max we ask for at a time, which better matches
correct behavior and might impact game behavior.
2019-04-23 20:18:16 -07:00
Unknown W. Brackets 709c9dc93c Mp3: Fix errors on sceMp3NotifyAddStreamData. 2019-04-23 19:48:01 -07:00
Unknown W. Brackets 5b9a3e6ca8 Mp3: Improve handle releasing behavior. 2019-04-22 23:01:40 -07:00
Unknown W. Brackets 4563d9487b Mp3: Better errors in sceMp3GetInfoToAddStreamData. 2019-04-22 22:57:05 -07:00
Unknown W. Brackets 351a10bd69 Mp3: Allow allocating two mp3 handles.
The handles are always 0 or 1, not pointers, which might be relied upon by
some games.  Two could be used with the same pointer.

This also makes NULL a valid pointer, which is used for low level mp3s.
2019-04-21 22:28:04 -07:00
Unknown W. Brackets 4ae2108629 Mp3: Fail to reserve if resource not inited.
Also, add a required parameter for sceMp3LowLevelInit, since it fails
unless proper values are passed for this on a PSP.
2019-04-21 19:54:34 -07:00
Unknown W. Brackets 92829d47fd Mp3: Better match resched on resource init/term.
It always seems to return 0, though.
2019-04-21 18:22:56 -07:00
Unknown W. Brackets fcf0518223 Update all the HLE tables with arg and ret info. 2015-03-22 20:51:55 -07:00
Lioncash 4ccb838306 Core: Mark some module functions as static 2014-12-08 04:40:08 -05:00
Henrik Rydgard cefc0bc96f Play the game's SND0.AT3 when a game is selected in the menu and on the "game screen". 2014-06-22 17:02:04 +02:00
Henrik Rydgard 1d0cc3417c Audio stuff: Cleanup, delete dead code 2014-06-22 14:01:23 +02:00
Unknown W. Brackets 29bd4b63e4 Fix a bunch of formatting warnings. 2014-05-21 07:59:58 -07:00
raven02 fbbd37d707 Delay thread for sceMp3Decode() 2014-04-15 21:55:28 +08:00
kaienfr c6a1b0e743 Provide a new method AuCtx::AuCreateCodecContextFromSource()
This method can automatically read audio information from file (as channels, sample rate etc) via ffmpeg,
and create accurate ffmpeg's codec context.
Especially used for unknown audio format but supported  by ffmpeg.
2014-04-14 13:23:10 +02:00
kaienfr 73d8786078 Change error log to info in sceMp3LowLevelInit 2014-04-14 12:00:19 +02:00
kaienfr d5fde0baee implement sceMp3GetFrameNum 2014-04-14 11:47:28 +02:00
kaienfr 6db28f0691 more cleanup 2014-04-13 21:42:46 +02:00
kaienfr d5e583ee14 correct some comments. 2014-04-13 21:15:41 +02:00
kaienfr ba34b211f1 Support sceMp3LowLevel*
Gundam G custom BGM is supported now :)
2014-04-13 21:11:04 +02:00
kaienfr 4eedd7a3cd Merge remote-tracking branch 'origin/master' into Universal_Audio_Branch 2014-04-13 14:39:56 +02:00
raven02 3a0b17a50f Put in parameters for sceMp3LowLevelInit/Decode 2014-04-13 17:18:18 +08:00
kaienfr e25bc6908a Fix nonsmooth sound issue and incomplete frame at the end of source and pcm buffers.
using a std::string to save the source buffer, and changing the loading strategy so as we will not get any incomplete frame.
2014-04-12 23:16:38 +02:00
kaienfr 976c9bbfdc Fix Dead and live freezing issue.
Just a typo in sceMp3 when using the universal class.
2014-04-12 15:46:35 +02:00
kaienfr a7691737b5 Transfer old mp3 savestate into new mode; Rename class functions sceAu... to Au...
Tests on games are just ok.
2014-04-12 02:12:25 +02:00
kaienfr ee1d541c28 Update minor comments 2014-04-11 23:42:07 +02:00
kaienfr 3a12cf2ad7 Universal Audio Class
Based on my implementation in sceAac https://github.com/hrydgard/ppsspp/pull/5836
I've created a class AuCtx included in My SimpleAudioDec.cpp/.h which aims at providing a standard easy implementation to support all codecs in ffmpeg.
Here, I also completely re-code sceMp3 file with this class to give an example how to use this class, and it has solved all mp3 issues I've observed in the current master.
Tests on different freq and channels mp3 audios as:
Miku custom BGM (48kHz, stereo), Hanayaka Nari Wa ga Ichizoku(32kHz, mono, a little fast but better than before now), downstreet panic (44.1kHz, stereo), and learn jp09(44.1kHz, stero) are just all right.
Especially, I am very glad to see that Miku's Custom BGMs have no repetition issues in first tone any more and no longer stopped in the first second neither. :)
We will come into a new age to fast support new audio formats from now on I hope :P
2014-04-11 22:56:59 +02:00
kaienfr c216b535ee Save current changes 2014-04-11 15:09:31 +02:00
raven02 c711f76eaa Use ctx->mp3Channels instead of setting frame.channel in case of FF incomplete frame 2014-04-10 20:48:16 +08:00
raven02 97c68de661 Parse MP3 header to correct set the channel and samplerate 2014-04-10 20:08:34 +08:00
Henrik Rydgård f328cfe655 Merge pull request #5816 from raven02/patch-8
No need to init packet as 0
2014-04-09 15:01:00 +02:00
sum2012 292e9baa08 Fix Integer divide in zero in sceMp3Decode 2014-04-08 23:11:55 +08:00
raven02 619039aed6 No need to init packet as {0} 2014-04-07 19:29:57 +08:00
kaienfr abec329e59 Mp3 file is not always have two channels 2014-04-07 03:52:43 +02:00
Henrik Rydgard 54d4663580 Revert "Merge pull request #5813 from raven02/patch-6"
This reverts commit 7b3828a9ae, reversing
changes made to c724a6c06a.
2014-04-06 21:09:28 +02:00
raven02 e73a49c2b2 sceMp3 : allocate audio frame 2014-04-06 20:48:57 +08:00
raven02 485b5df7cf Remove (AVFormatContext**) 2014-04-06 17:32:28 +08:00
raven02 5b19f1d53c Cleanup /* ... */ 2014-04-05 23:25:49 +08:00
raven02 4a35c726b3 Log channel/samplerate/bitrate 2014-04-05 21:57:26 +08:00
raven02 3b793a55e2 Remove some obsolete unused code 2014-04-05 20:29:00 +08:00
raven02 b6ccd650ff sceMp3 : use bswap32 for swapping endian 2014-04-05 15:26:22 +08:00
Unknown W. Brackets aea26f666c Clean up some atrac/mp3 potential leaks. 2014-03-30 15:08:38 -07:00
raven02 7577481d6e Change it to ctx->bufferWrite %= ctx->mp3BufSize; 2014-03-29 12:37:33 +08:00
raven02 790c570e67 Fix crash and wrong mp3 playback in Downstream Panic ULUS10322 2014-03-29 12:16:57 +08:00
Unknown W. Brackets 05ab192c9c Reduce includes in Core/HLE/.
Especially templates.
2014-03-15 11:22:19 -07:00
Unknown W. Brackets c7437bbe8e Fix some minor warnings. 2014-03-03 00:08:32 -08:00
raven02 81887cead3 Init ctx->mp3DecodedBytes/mp3SumDecodedSamples/mp3LoopNum 2014-02-15 22:50:10 +08:00
sum2012 9868734656 Add report 2014-02-15 20:20:04 +08:00
sum2012 88d1cb7016 More logging 2014-02-15 20:15:49 +08:00
sum2012 63adafd967 avoid invalid memory in sceMp3ReserveMp3Handle
Find in Heroes Phantasia
2014-02-15 07:28:52 +08:00