diff gui/win32/interface.c @ 34399:f2c03009068d

Don't explicitly set stream type if the type doesn't change. Use a self-explanatory symbolic constant which makes the code more easily understandable.
author ib
date Mon, 02 Jan 2012 15:16:55 +0000
parents 4c8bdc633648
children 19b68f388735
line wrap: on
line diff
--- a/gui/win32/interface.c	Mon Jan 02 12:53:20 2012 +0000
+++ b/gui/win32/interface.c	Mon Jan 02 15:16:55 2012 +0000
@@ -66,6 +66,8 @@
 #include <cdio/cdio.h>
 #endif
 
+#define SAME_STREAMTYPE (STREAMTYPE_DUMMY - 1)
+
 int guiWinID = 0;
 
 char *skinName = NULL;
@@ -441,6 +443,8 @@
     // it will find the filename in the Linux filesystem.
     filename = unix_name(filename);
 #endif
+
+    if (type != SAME_STREAMTYPE)
     guiInfo.StreamType = type;
 
     nfree(guiInfo.AudioFilename);
@@ -561,7 +565,7 @@
             {
                 case STREAMTYPE_FILE:
                 case STREAMTYPE_STREAM:
-                    uiSetFileName(NULL, mygui->playlist->tracks[mygui->playlist->current]->filename, STREAMTYPE_FILE);
+                    uiSetFileName(NULL, mygui->playlist->tracks[mygui->playlist->current]->filename, SAME_STREAMTYPE);
                     guiInfo.Track = mygui->playlist->current + 1;
                     break;
 #ifdef CONFIG_DVDREAD
@@ -571,7 +575,7 @@
                     dvd_chapter = guiInfo.Chapter;
                     dvd_angle = guiInfo.Angle;
                     sprintf(tmp,"dvd://%d", guiInfo.Track);
-                    uiSetFileName(NULL, tmp, STREAMTYPE_DVD);
+                    uiSetFileName(NULL, tmp, SAME_STREAMTYPE);
                     break;
                 }
 #endif