Fix playback bug & don't stop on every file select
Fixed a bug where ctrmus would freeze after selecting an unsupported file. Fixed a bug whereby selecting an unsupported file would stop playback. Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
This commit is contained in:
@@ -82,6 +82,13 @@ static int changeFile(const char* ep_file, struct playbackInfo_t* playbackInfo)
|
||||
s32 prio;
|
||||
static Thread thread = NULL;
|
||||
|
||||
if(ep_file != NULL && getFileType(ep_file) == FILE_TYPE_ERROR)
|
||||
{
|
||||
*playbackInfo->errInfo->error = errno;
|
||||
svcSignalEvent(*playbackInfo->errInfo->failEvent);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* If music is playing, stop it. Only one playback thread should be playing
|
||||
* at any time.
|
||||
@@ -94,9 +101,6 @@ static int changeFile(const char* ep_file, struct playbackInfo_t* playbackInfo)
|
||||
threadJoin(thread, U64_MAX);
|
||||
threadFree(thread);
|
||||
thread = NULL;
|
||||
|
||||
/* free allocated file string */
|
||||
delete(playbackInfo->file);
|
||||
}
|
||||
|
||||
if(ep_file == NULL || playbackInfo == NULL)
|
||||
|
||||
Reference in New Issue
Block a user