mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-06-02 04:36:57 -06:00
cellMusicDecode: fix track index on next if already on last track
Fixes an OOB exception
This commit is contained in:
parent
fa1aa9dcf3
commit
f8a5a6ad93
@ -387,6 +387,12 @@ error_code cellMusicDecodeSetDecodeCommand(s32 command)
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
//sysutil_register_cb([&dec, command](ppu_thread& ppu) -> s32
|
||||
//{
|
||||
// dec.func(ppu, CELL_MUSIC_DECODE_EVENT_STATUS_NOTIFICATION, vm::addr_t(command), dec.userData);
|
||||
// return CELL_OK;
|
||||
//});
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
||||
@ -301,7 +301,7 @@ u32 music_selection_context::step_track(bool next)
|
||||
{
|
||||
// We are at the end of the playlist.
|
||||
cellMusicSelectionContext.notice("step_track: No more tracks to play in playlist...");
|
||||
current_track = umax;
|
||||
current_track = playlist.size() - 1; // NOTE: We could use size instead of size - 1 to allow to use PREV to play the last track again.
|
||||
return umax;
|
||||
}
|
||||
}
|
||||
|
||||
@ -477,6 +477,8 @@ namespace utils
|
||||
|
||||
void audio_decoder::clear()
|
||||
{
|
||||
media_log.notice("audio_decoder: Clear data...");
|
||||
|
||||
track_fully_decoded = 0;
|
||||
track_fully_consumed = 0;
|
||||
has_error = false;
|
||||
@ -487,6 +489,8 @@ namespace utils
|
||||
|
||||
void audio_decoder::stop()
|
||||
{
|
||||
media_log.notice("audio_decoder: Stop decoding...");
|
||||
|
||||
if (m_thread)
|
||||
{
|
||||
auto& thread = *m_thread;
|
||||
@ -695,7 +699,7 @@ namespace utils
|
||||
if (buffer)
|
||||
av_freep(&buffer);
|
||||
|
||||
media_log.notice("audio_decoder: decoded frame_count=%d buffer_size=%d timestamp_us=%d", frame_count, buffer_size, av.audio.frame->best_effort_timestamp);
|
||||
media_log.trace("audio_decoder: decoded frame_count=%d buffer_size=%d timestamp_us=%d", frame_count, buffer_size, av.audio.frame->best_effort_timestamp);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user