From 510db2051d724ddad83c53c019f47dbc3da8ad4a Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 30 May 2016 23:55:13 -0700 Subject: [PATCH] Psmf: Detect PCM streams from private stream info. This logic comes from Jpcsp. Let's report though and see if there's more. --- Core/HLE/scePsmf.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Core/HLE/scePsmf.cpp b/Core/HLE/scePsmf.cpp index f875b623e..0d8675082 100644 --- a/Core/HLE/scePsmf.cpp +++ b/Core/HLE/scePsmf.cpp @@ -359,10 +359,16 @@ Psmf::Psmf(const u8 *ptr, u32 data) { const u8 *const currentStreamAddr = ptr + 0x82 + i * 16; int streamId = currentStreamAddr[0]; if ((streamId & PSMF_VIDEO_STREAM_ID) == PSMF_VIDEO_STREAM_ID) { - stream = new PsmfStream(PSMF_AVC_STREAM, ++currentVideoStreamNum); + stream = new PsmfStream(PSMF_AVC_STREAM, streamId & 0x0F); stream->readMPEGVideoStreamParams(currentStreamAddr, ptr, this); } else if ((streamId & PSMF_AUDIO_STREAM_ID) == PSMF_AUDIO_STREAM_ID) { - stream = new PsmfStream(PSMF_ATRAC_STREAM, ++currentAudioStreamNum); + int type = PSMF_ATRAC_STREAM; + int privateStreamId = currentStreamAddr[1]; + if ((privateStreamId & 0xF0) != 0) { + WARN_LOG_REPORT(ME, "Unknown private stream type, assuming PCM: %02x", privateStreamId); + type = PSMF_PCM_STREAM; + } + stream = new PsmfStream(type, privateStreamId & 0x0F); stream->readPrivateAudioStreamParams(currentStreamAddr, this); } if (stream) {