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

Function cellMusicDecodeSetDecodeCommand2

ps3fw/cellMusicDecode.cpp:547–575  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

545}
546
547error_code cellMusicDecodeSetDecodeCommand2(s32 command)
548{
549 cellMusicDecode.warning("cellMusicDecodeSetDecodeCommand2(command=0x%x)", command);
550
551 if (command < CELL_MUSIC_DECODE_CMD_STOP || command > CELL_MUSIC_DECODE_CMD_PREV)
552 {
553 return CELL_MUSIC_DECODE_ERROR_PARAM;
554 }
555
556 auto& dec = g_fxo->get<music_decode2>();
557 std::lock_guard lock(dec.mutex);
558
559 if (!dec.func)
560 return CELL_MUSIC_DECODE_ERROR_GENERIC;
561
562 error_code result = CELL_OK;
563 {
564 std::scoped_lock slock(dec.decoder.m_mtx);
565 result = dec.set_decode_command(command);
566 }
567
568 sysutil_register_cb([&dec, result](ppu_thread& ppu) -> s32
569 {
570 dec.func(ppu, CELL_MUSIC_DECODE_EVENT_SET_DECODE_COMMAND_RESULT, vm::addr_t(s32{result}), dec.userData);
571 return CELL_OK;
572 });
573
574 return CELL_OK;
575}
576
577error_code cellMusicDecodeGetDecodeStatus2(vm::ptr<s32> status)
578{

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