Exemple #1
0
int cellAdecClose(u32 handle)
{
	cellAdec.Warning("cellAdecClose(handle=%d)", handle);

	AudioDecoder* adec;
	if (!Emu.GetIdManager().GetIDData(handle, adec))
	{
		return CELL_ADEC_ERROR_ARG;
	}

	adec->job.Push(AdecTask(adecClose));

	while (!adec->is_finished || !adec->frames.IsEmpty())
	{
		if (Emu.IsStopped())
		{
			ConLog.Warning("cellAdecClose(%d) aborted", handle);
			break;
		}
		Sleep(1);
	}

	if (adec->adecCb) Emu.GetCPU().RemoveThread(adec->adecCb->GetId());
	Emu.GetIdManager().RemoveID(handle);
	return CELL_OK;
}
Exemple #2
0
int cellAdecClose(u32 handle)
{
	cellAdec->Warning("cellAdecClose(handle=%d)", handle);

	AudioDecoder* adec;
	if (!Emu.GetIdManager().GetIDData(handle, adec))
	{
		return CELL_ADEC_ERROR_ARG;
	}

	adec->job.Push(AdecTask(adecClose));

	while (!adec->is_finished)
	{
		if (Emu.IsStopped())
		{
			cellAdec->Warning("cellAdecClose(%d) aborted", handle);
			break;
		}
		std::this_thread::sleep_for(std::chrono::milliseconds(1));
	}

	if (adec->adecCb) Emu.GetCPU().RemoveThread(adec->adecCb->GetId());
	Emu.GetIdManager().RemoveID(handle);
	return CELL_OK;
}
Exemple #3
0
int cellAdecEndSeq(u32 handle)
{
	cellAdec.Warning("cellAdecEndSeq(handle=%d)", handle);

	AudioDecoder* adec;
	if (!Emu.GetIdManager().GetIDData(handle, adec))
	{
		return CELL_ADEC_ERROR_ARG;
	}

	adec->job.Push(AdecTask(adecEndSeq));
	return CELL_OK;
}