Add Vorbis decoder

Additionally implemented better handling of the playback stopping
procedure.

Signed-off-by: Mahyar Koshkouei <mk@deltabeard.com>
This commit is contained in:
Mahyar Koshkouei
2017-07-08 11:07:28 +01:00
parent c6f27ae957
commit ed5eaba746
5 changed files with 196 additions and 5 deletions

View File

@@ -52,7 +52,7 @@ void playbackWatchdog(void* infoIn)
svcWaitSynchronization(*info->errInfo->failEvent, U64_MAX);
svcClearEvent(*info->errInfo->failEvent);
if(*info->errInfo->error != 0)
if(*info->errInfo->error > 0)
{
consoleSelect(info->screen);
printf("Error %d: %s", *info->errInfo->error,
@@ -66,6 +66,14 @@ void playbackWatchdog(void* infoIn)
printf("\n");
}
else if (*info->errInfo->error == -1)
{
/* Used to signify that playback has stopped.
* Not technically an error.
*/
consoleSelect(info->screen);
puts("Stopped");
}
}
return;
@@ -391,8 +399,9 @@ int main(int argc, char **argv)
{
stopPlayback();
changeFile(NULL, &playbackInfo);
consoleSelect(&topScreen);
puts("Stopped");
/* If the playback thread is currently playing, it will now
* stop and tell the Watchdog thread to display "Stopped".
*/
continue;
}
}