From 2e5f4f160b1809082d9e458b98da9ef253113f4d Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 5 Aug 2014 10:04:03 -0600 Subject: [PATCH] Costmetic changes --- system/nxplayer/nxplayer_main.c | 49 ++++++++++++++++----------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/system/nxplayer/nxplayer_main.c b/system/nxplayer/nxplayer_main.c index e9849cf69..48a9a2bfa 100644 --- a/system/nxplayer/nxplayer_main.c +++ b/system/nxplayer/nxplayer_main.c @@ -198,34 +198,33 @@ static int nxplayer_cmd_play(FAR struct nxplayer_s *pPlayer, char* parg) * -ENOENT The media file was not found */ - if (ret == -ENODEV) + switch (-ret) { - printf("No suitable Audio Device found\n"); + case OK: + break; + + case ENODEV: + printf("No suitable Audio Device found\n"); + break; + + case EBUSY: + printf("Audio device busy\n"); + break; + + case ENOENT: + printf("File %s not found\n", parg); + break; + + case ENOSYS: + printf("Unknown audio format\n"); + break; + + default: + printf("Error playing file: %d\n", -ret); + break; } - else if (ret == -EBUSY) - { - printf("Audio device busy\n"); - } - - else if (ret == -ENOENT) - { - printf("File %s not found\n", parg); - } - - else if (ret == -ENOSYS) - { - printf("Unknown audio format\n"); - } - - if (ret < 0) - { - return ret; - } - - /* File playing successfully */ - - return OK; + return ret; } /****************************************************************************