MCPcopy Create free account
hub / github.com/RPCSX/rpcsx / cellMusicDecodeSetDecodeCommand

Function cellMusicDecodeSetDecodeCommand

ps3fw/cellMusicDecode.cpp:360–388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

358}
359
360error_code cellMusicDecodeSetDecodeCommand(s32 command)
361{
362 cellMusicDecode.warning("cellMusicDecodeSetDecodeCommand(command=0x%x)", command);
363
364 if (command < CELL_MUSIC_DECODE_CMD_STOP || command > CELL_MUSIC_DECODE_CMD_PREV)
365 {
366 return CELL_MUSIC_DECODE_ERROR_PARAM;
367 }
368
369 auto& dec = g_fxo->get<music_decode>();
370 std::lock_guard lock(dec.mutex);
371
372 if (!dec.func)
373 return CELL_MUSIC_DECODE_ERROR_GENERIC;
374
375 error_code result = CELL_OK;
376 {
377 std::scoped_lock slock(dec.decoder.m_mtx);
378 result = dec.set_decode_command(command);
379 }
380
381 sysutil_register_cb([&dec, result](ppu_thread& ppu) -> s32
382 {
383 dec.func(ppu, CELL_MUSIC_DECODE_EVENT_SET_DECODE_COMMAND_RESULT, vm::addr_t(s32{result}), dec.userData);
384 return CELL_OK;
385 });
386
387 return CELL_OK;
388}
389
390error_code cellMusicDecodeGetDecodeStatus(vm::ptr<s32> status)
391{

Callers

nothing calls this directly

Calls 3

sysutil_register_cbFunction · 0.85
addr_tEnum · 0.85
set_decode_commandMethod · 0.80

Tested by

no test coverage detected