[MPlayer-cvslog] r35483 - in trunk/gui: interface.c interface.h ui/main.c
ib
subversion at mplayerhq.hu
Mon Nov 26 11:48:26 CET 2012
Author: ib
Date: Mon Nov 26 11:48:26 2012
New Revision: 35483
Log:
Simplify playlist handling by defining a symbolic constant.
This should make the code also easier to read.
Modified:
trunk/gui/interface.c
trunk/gui/interface.h
trunk/gui/ui/main.c
Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c Sun Nov 25 23:56:28 2012 (r35482)
+++ trunk/gui/interface.c Mon Nov 26 11:48:26 2012 (r35483)
@@ -789,9 +789,7 @@ int gui(int what, void *data)
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;
Modified: trunk/gui/interface.h
==============================================================================
--- trunk/gui/interface.h Sun Nov 25 23:56:28 2012 (r35482)
+++ trunk/gui/interface.h Mon Nov 26 11:48:26 2012 (r35483)
@@ -69,6 +69,9 @@ enum {
#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,
Modified: trunk/gui/ui/main.c
==============================================================================
--- trunk/gui/ui/main.c Sun Nov 25 23:56:28 2012 (r35482)
+++ trunk/gui/ui/main.c Mon Nov 26 11:48:26 2012 (r35483)
@@ -208,7 +208,7 @@ play:
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 );
More information about the MPlayer-cvslog
mailing list