mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
mpeg: Minor cleanup
This commit is contained in:
parent
ec169e9fa9
commit
eff9bd1fc3
3 changed files with 21 additions and 20 deletions
|
@ -168,7 +168,7 @@ int Atrac2::RemainingFrames() const {
|
|||
Atrac2::Atrac2(u32 contextAddr, int codecType) {
|
||||
if (contextAddr) {
|
||||
context_ = PSPPointer<SceAtracContext>::Create(contextAddr);
|
||||
// First-time initialization.
|
||||
// First-time initialization. The rest is initialized in SetData.
|
||||
SceAtracIdInfo &info = context_->info;
|
||||
info.codec = codecType;
|
||||
info.state = ATRAC_STATUS_NO_DATA;
|
||||
|
|
|
@ -284,23 +284,6 @@ static MpegContext *getMpegCtx(u32 mpegAddr) {
|
|||
return res;
|
||||
}
|
||||
|
||||
static void InitRingbuffer(SceMpegRingBuffer *buf, int packets, int data, int size, int callback_addr, int callback_args) {
|
||||
buf->packets = packets;
|
||||
buf->packetsRead = 0;
|
||||
buf->packetsWritePos = 0;
|
||||
buf->packetsAvail = 0;
|
||||
buf->packetSize = 2048;
|
||||
buf->data = data;
|
||||
buf->callback_addr = callback_addr;
|
||||
buf->callback_args = callback_args;
|
||||
buf->dataUpperBound = data + packets * 2048;
|
||||
buf->semaID = 0;
|
||||
buf->mpeg = 0;
|
||||
// This isn't in ver 0104, but it is in 0105.
|
||||
if (mpegLibVersion >= 0x0105)
|
||||
buf->gp = __KernelGetModuleGP(__KernelGetCurThreadModuleId());
|
||||
}
|
||||
|
||||
static u32 convertTimestampToDate(u32 ts) {
|
||||
return ts; // TODO
|
||||
}
|
||||
|
@ -497,7 +480,25 @@ static u32 sceMpegRingbufferConstruct(u32 ringbufferAddr, u32 numPackets, u32 da
|
|||
}
|
||||
|
||||
auto ring = PSPPointer<SceMpegRingBuffer>::Create(ringbufferAddr);
|
||||
InitRingbuffer(ring, numPackets, data, size, callbackAddr, callbackArg);
|
||||
|
||||
ring->packets = numPackets;
|
||||
ring->packetsRead = 0;
|
||||
ring->packetsWritePos = 0;
|
||||
ring->packetsAvail = 0;
|
||||
ring->packetSize = 2048;
|
||||
ring->data = data;
|
||||
ring->callback_addr = callbackAddr;
|
||||
ring->callback_args = callbackArg;
|
||||
ring->dataUpperBound = data + numPackets * 2048;
|
||||
if (ring->semaID != 0) {
|
||||
// I'm starting to think this is just padding or something.
|
||||
// It's not written by this function.
|
||||
WARN_LOG(Log::ME, "Detected semaID %d", ring->semaID);
|
||||
}
|
||||
ring->mpeg = 0;
|
||||
// This isn't in ver 0104, but it is in 0105.
|
||||
if (mpegLibVersion >= 0x0105)
|
||||
ring->gp = __KernelGetModuleGP(__KernelGetCurThreadModuleId());
|
||||
return hleLogDebug(Log::ME, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -1680,7 +1680,7 @@ static u32 scePsmfPlayerGetCurrentPts(u32 psmfPlayer, u32 currentPtsAddr)
|
|||
if (Memory::IsValidAddress(currentPtsAddr)) {
|
||||
Memory::Write_U32(psmfplayer->psmfPlayerAvcAu.pts, currentPtsAddr);
|
||||
}
|
||||
return hleLogDebug(Log::ME, 0);
|
||||
return hleLogDebug(Log::ME, 0, "pts: %d", psmfplayer->psmfPlayerAvcAu.pts);
|
||||
}
|
||||
|
||||
static u32 scePsmfPlayerGetPsmfInfo(u32 psmfPlayer, u32 psmfInfoAddr, u32 widthAddr, u32 heightAddr) {
|
||||
|
|
Loading…
Add table
Reference in a new issue