# HG changeset patch # User ib # Date 1353926906 0 # Node ID a54338c73df8a7fee9bfca4530bbf8afe45fd489 # Parent 6c9c58ad43a32b1b889c778dad3d8787d5d1b051 Simplify playlist handling by defining a symbolic constant. This should make the code also easier to read. diff -r 6c9c58ad43a3 -r a54338c73df8 gui/interface.c --- a/gui/interface.c Sun Nov 25 22:56:28 2012 +0000 +++ b/gui/interface.c Mon Nov 26 10:48:26 2012 +0000 @@ -789,9 +789,7 @@ filename = NULL; - if (!listMgr(PLAYLIST_ITEM_GET_CURR, 0) && - (guiInfo.StreamType == STREAMTYPE_FILE || - guiInfo.StreamType == STREAMTYPE_STREAM)) + if (isPlaylistStreamtype && !listMgr(PLAYLIST_ITEM_GET_CURR, 0)) uiSetFileName(NULL, NULL, STREAMTYPE_DUMMY); guiInfo.ElapsedTime = 0; diff -r 6c9c58ad43a3 -r a54338c73df8 gui/interface.h --- a/gui/interface.h Sun Nov 25 22:56:28 2012 +0000 +++ b/gui/interface.h Mon Nov 26 10:48:26 2012 +0000 @@ -69,6 +69,9 @@ #define GUI_FILE_NEW 2 //@} +/// StreamTypes that are permitted in a playlist +#define isPlaylistStreamtype (guiInfo.StreamType == STREAMTYPE_FILE || guiInfo.StreamType == STREAMTYPE_STREAM) + /// mplayer() instructions enum { MPLAYER_EXIT_GUI, diff -r 6c9c58ad43a3 -r a54338c73df8 gui/ui/main.c --- a/gui/ui/main.c Sun Nov 25 22:56:28 2012 +0000 +++ b/gui/ui/main.c Mon Nov 26 10:48:26 2012 +0000 @@ -208,7 +208,7 @@ if ( ( msg == evPlaySwitchToPause )&&( guiInfo.Playing == GUI_PAUSE ) ) goto NoPause; - if ( listMgr( PLAYLIST_ITEM_GET_CURR,0 ) &&( guiInfo.StreamType == STREAMTYPE_FILE || guiInfo.StreamType == STREAMTYPE_STREAM ) ) + if ( isPlaylistStreamtype && listMgr( PLAYLIST_ITEM_GET_CURR,0 ) ) { plItem * curr = listMgr( PLAYLIST_ITEM_GET_CURR,0 ); uiSetFileName( curr->path,curr->name,SAME_STREAMTYPE );