Skip to content
This repository has been archived by the owner on May 7, 2023. It is now read-only.

Commit

Permalink
Fix cover loader logic
Browse files Browse the repository at this point in the history
  • Loading branch information
GrapheneCt committed Jul 15, 2021
1 parent 4624d1f commit 1492af0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
2 changes: 2 additions & 0 deletions ElevenMPV-A/include/menus/menu_audioplayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ namespace menu {

static SceVoid HandleNext(SceBool fromHandlePrev, SceBool fromFfButton);

static SceVoid ReloadCoverForNext();

static SceVoid HandlePrev();

static SceVoid ConvertSecondsToString(String *string, SceUInt64 seconds, SceBool needSeparator);
Expand Down
2 changes: 1 addition & 1 deletion ElevenMPV-A/param.sfx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<paramsfo>
<param key="APP_VER">05.02</param>
<param key="APP_VER">05.03</param>
<param key="ATTRIBUTE">17338504</param>
<param key="ATTRIBUTE_MINOR">17</param>
<param key="ATTRIBUTE2">0</param>
Expand Down
18 changes: 12 additions & 6 deletions ElevenMPV-A/source/menus/menu_audioplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ static SceUInt64 s_oldCurrentPosSec = 0;

static String *s_totalLength;

SceVoid menu::audioplayer::Audioplayer::ReloadCoverForNext()
{
// Handle cover
if (g_currentPlayerInstance->core->GetDecoder()->coverLoader == SCE_NULL && !g_currentPlayerInstance->core->GetDecoder()->GetMetadataLocation()->hasCover) {
g_currentPlayerInstance->core->GetDecoder()->coverLoader = new audio::PlayerCoverLoaderThread(SCE_KERNEL_COMMON_QUEUE_HIGHEST_PRIORITY, SCE_KERNEL_4KiB, "EMPVA::PlayerCoverLoader");
g_currentPlayerInstance->core->GetDecoder()->coverLoader->workptr = SCE_NULL;
g_currentPlayerInstance->core->GetDecoder()->coverLoader->Start();
}
}

SceVoid menu::audioplayer::Audioplayer::HandleNext(SceBool fromHandlePrev, SceBool fromFfButton)
{
Resource::Element searchParam;
Expand All @@ -77,6 +87,7 @@ SceVoid menu::audioplayer::Audioplayer::HandleNext(SceBool fromHandlePrev, SceBo

if (s_repeatState == REPEAT_STATE_ONE && !fromHandlePrev && !fromFfButton) {
g_currentPlayerInstance->core = new AudioplayerCore(g_currentPlayerInstance->playlist.path[g_currentPlayerInstance->playlistIdx]->data);
ReloadCoverForNext();
return;
}

Expand Down Expand Up @@ -132,12 +143,7 @@ SceVoid menu::audioplayer::Audioplayer::HandleNext(SceBool fromHandlePrev, SceBo
text8.Clear();
text16.Clear();

// Handle cover
if (g_currentPlayerInstance->core->GetDecoder()->coverLoader == SCE_NULL && !g_currentPlayerInstance->core->GetDecoder()->GetMetadataLocation()->hasCover) {
g_currentPlayerInstance->core->GetDecoder()->coverLoader = new audio::PlayerCoverLoaderThread(SCE_KERNEL_COMMON_QUEUE_HIGHEST_PRIORITY, SCE_KERNEL_4KiB, "EMPVA::PlayerCoverLoader");
g_currentPlayerInstance->core->GetDecoder()->coverLoader->workptr = SCE_NULL;
g_currentPlayerInstance->core->GetDecoder()->coverLoader->Start();
}
ReloadCoverForNext();
}

SceVoid menu::audioplayer::Audioplayer::HandlePrev()
Expand Down

0 comments on commit 1492af0

Please sign in to comment.