[MPlayer-cvslog] r34542 - in trunk/gui: cfg.c interface.c interface.h ui/actions.c ui/gtk/menu.c ui/gtk/preferences.c ui/main.c ui/render.c util/string.c win32/dialogs.c win32/gui.c win32/interface.c win32/widgetre...

ib subversion at mplayerhq.hu
Thu Jan 12 11:08:25 CET 2012


Author: ib
Date: Thu Jan 12 11:08:25 2012
New Revision: 34542

Log:
Remove all unnecessary #ifdefs from GUI code.

Move or add necessary ones.

Modified:
   trunk/gui/cfg.c
   trunk/gui/interface.c
   trunk/gui/interface.h
   trunk/gui/ui/actions.c
   trunk/gui/ui/gtk/menu.c
   trunk/gui/ui/gtk/preferences.c
   trunk/gui/ui/main.c
   trunk/gui/ui/render.c
   trunk/gui/util/string.c
   trunk/gui/win32/dialogs.c
   trunk/gui/win32/gui.c
   trunk/gui/win32/interface.c
   trunk/gui/win32/widgetrender.c
   trunk/gui/wm/ws.c

Modified: trunk/gui/cfg.c
==============================================================================
--- trunk/gui/cfg.c	Thu Jan 12 11:07:22 2012	(r34541)
+++ trunk/gui/cfg.c	Thu Jan 12 11:08:25 2012	(r34542)
@@ -47,10 +47,8 @@ int gtkCacheSize = 2048;
 
 int gtkVfPP;
 
-#ifdef CONFIG_DXR3
 int gtkVfLAVC;
 char *gtkDXR3Device;
-#endif
 
 int gtkAutoSyncOn;
 int gtkAutoSync;
@@ -60,25 +58,17 @@ int gtkAOSurround;
 int gtkAOExtraStereo;
 float gtkAOExtraStereoMul = 1.0f;
 
-#ifdef CONFIG_ALSA
 char *gtkAOALSAMixer;
 char *gtkAOALSAMixerChannel;
 char *gtkAOALSADevice;
-#endif
 
-#ifdef CONFIG_OSS_AUDIO
 char *gtkAOOSSMixer;
 char *gtkAOOSSMixerChannel;
 char *gtkAOOSSDevice;
-#endif
 
-#ifdef CONFIG_ESD
 char *gtkAOESDDevice;
-#endif
 
-#ifdef CONFIG_SDL
 char *gtkAOSDLDriver;
-#endif
 
 int gtkEnableAudioEqualizer;
 float gtkEquChannels[6][10];
@@ -86,9 +76,7 @@ float gtkEquChannels[6][10];
 int gtkSubDumpMPSub;
 int gtkSubDumpSrt;
 
-#ifdef CONFIG_ASS
 gtkASS_t gtkASS;
-#endif
 
 int gtkEnablePlayBar = 1;
 int gtkLoadFullscreen;

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Thu Jan 12 11:07:22 2012	(r34541)
+++ trunk/gui/interface.c	Thu Jan 12 11:08:25 2012	(r34542)
@@ -75,11 +75,8 @@ void guiInit(void)
         cdrom_device = strdup(DEFAULT_CDROM_DEVICE);
     if (!dvd_device)
         dvd_device = strdup(DEFAULT_DVD_DEVICE);
-
-#ifdef CONFIG_DXR3
     if (!gtkDXR3Device)
         gtkDXR3Device = strdup("/dev/em8300-0");
-#endif
 
     if (stream_cache_size > 0) {
         gtkCacheOn   = 1;
@@ -92,12 +89,10 @@ void guiInit(void)
         gtkAutoSync   = autosync;
     }
 
-#ifdef CONFIG_ASS
     gtkASS.enabled       = ass_enabled;
     gtkASS.use_margins   = ass_use_margins;
     gtkASS.top_margin    = ass_top_margin;
     gtkASS.bottom_margin = ass_bottom_margin;
-#endif
 
     gtkInit();
 
@@ -263,12 +258,10 @@ void guiDone(void)
             gui_sub_pos_y  = guiApp.sub.y;
         }
 
-#ifdef CONFIG_ASS
         ass_enabled       = gtkASS.enabled;
         ass_use_margins   = gtkASS.use_margins;
         ass_top_margin    = gtkASS.top_margin;
         ass_bottom_margin = gtkASS.bottom_margin;
-#endif
 
         cfg_write();
         wsXDone();
@@ -415,7 +408,6 @@ int gui(int what, void *data)
         case STREAMTYPE_STREAM:
             break;
 
-#ifdef CONFIG_CDDA
         case STREAMTYPE_CDDA:
         {
             char tmp[512];
@@ -424,9 +416,7 @@ int gui(int what, void *data)
             uiSetFileName(NULL, tmp, SAME_STREAMTYPE);
         }
         break;
-#endif
 
-#ifdef CONFIG_VCD
         case STREAMTYPE_VCD:
         {
             char tmp[512];
@@ -435,9 +425,7 @@ int gui(int what, void *data)
             uiSetFileName(NULL, tmp, SAME_STREAMTYPE);
         }
         break;
-#endif
 
-#ifdef CONFIG_DVDREAD
         case STREAMTYPE_DVD:
         {
             char tmp[512];
@@ -450,7 +438,6 @@ int gui(int what, void *data)
             dvd_angle   = guiInfo.Angle;
 
             break;
-#endif
         }
 
         // video opts
@@ -486,12 +473,10 @@ int gui(int what, void *data)
             }
         }
 
-#ifdef CONFIG_DXR3
         if (video_driver_list && !gstrcmp(video_driver_list[0], "dxr3"))
             if (guiInfo.StreamType != STREAMTYPE_DVD && guiInfo.StreamType != STREAMTYPE_VCD)
                 if (gtkVfLAVC)
                     add_vf("lavc");
-#endif
 
         if (gtkVfPP)
             add_vf("pp");
@@ -515,7 +500,6 @@ int gui(int what, void *data)
             free(name);
         }
 
-#ifdef CONFIG_OSS_AUDIO
         if (audio_driver_list && !gstrncmp(audio_driver_list[0], "oss", 3)) {
             char *tmp;
 
@@ -531,9 +515,7 @@ int gui(int what, void *data)
             gaddlist(&audio_driver_list, tmp);
             free(tmp);
         }
-#endif
 
-#ifdef CONFIG_ALSA
         if (audio_driver_list && !gstrncmp(audio_driver_list[0], "alsa", 4)) {
             char *tmp;
 
@@ -549,9 +531,7 @@ int gui(int what, void *data)
             gaddlist(&audio_driver_list, tmp);
             free(tmp);
         }
-#endif
 
-#ifdef CONFIG_SDL
         if (audio_driver_list && !gstrncmp(audio_driver_list[0], "sdl", 3)) {
             char *tmp;
 
@@ -564,9 +544,7 @@ int gui(int what, void *data)
             gaddlist(&audio_driver_list, tmp);
             free(tmp);
         }
-#endif
 
-#ifdef CONFIG_ESD
         if (audio_driver_list && !gstrncmp(audio_driver_list[0], "esd", 3)) {
             char *tmp;
 
@@ -579,7 +557,6 @@ int gui(int what, void *data)
             gaddlist(&audio_driver_list, tmp);
             free(tmp);
         }
-#endif
 
         // subtitle
 
@@ -612,12 +589,10 @@ int gui(int what, void *data)
 
         guiInfo.NewPlay = 0;
 
-#ifdef CONFIG_ASS
         ass_enabled       = gtkASS.enabled;
         ass_use_margins   = gtkASS.use_margins;
         ass_top_margin    = gtkASS.top_margin;
         ass_bottom_margin = gtkASS.bottom_margin;
-#endif
 
         break;
 
@@ -631,21 +606,16 @@ int gui(int what, void *data)
         case STREAMTYPE_STREAM:
             break;
 
-#ifdef CONFIG_CDDA
         case STREAMTYPE_CDDA:
             guiInfo.Tracks = 0;
             stream_control(stream, STREAM_CTRL_GET_NUM_TITLES, &guiInfo.Tracks);
             break;
-#endif
 
-#ifdef CONFIG_VCD
         case STREAMTYPE_VCD:
             guiInfo.Tracks = 0;
             stream_control(stream, STREAM_CTRL_GET_NUM_TITLES, &guiInfo.Tracks);
             break;
-#endif
 
-#ifdef CONFIG_DVDREAD
         case STREAMTYPE_DVD:
             guiInfo.Tracks = 0;
             stream_control(stream, STREAM_CTRL_GET_NUM_TITLES, &guiInfo.Tracks);
@@ -653,16 +623,17 @@ int gui(int what, void *data)
             stream_control(stream, STREAM_CTRL_GET_NUM_CHAPTERS, &guiInfo.Chapters);
             guiInfo.Angles = 0;
             stream_control(stream, STREAM_CTRL_GET_NUM_ANGLES, &guiInfo.Angles);
+#ifdef CONFIG_DVDREAD
             dvd = stream->priv;
             guiInfo.AudioStreams = dvd->nr_of_channels;
             memcpy(guiInfo.AudioStream, dvd->audio_streams, sizeof(dvd->audio_streams));
             guiInfo.Subtitles = dvd->nr_of_subtitles;
             memcpy(guiInfo.Subtitle, dvd->subtitles, sizeof(dvd->subtitles));
+#endif
             guiInfo.Track   = dvd_title + 1;
             guiInfo.Chapter = dvd_chapter + 1;
             guiInfo.Angle   = dvd_angle + 1;
             break;
-#endif
         }
 
         break;
@@ -686,12 +657,10 @@ int gui(int what, void *data)
         btnSet(evBackward10min, state);
         btnSet(evSetMoviePosition, state);
 
-#ifdef CONFIG_DXR3
         if (video_driver_list && !gstrcmp(video_driver_list[0], "dxr3") && (((demuxer_t *)mpctx_get_demuxer(guiInfo.mpcontext))->file_format != DEMUXER_TYPE_MPEG_PS) && !gtkVfLAVC) {
             gtkMessageBox(GTK_MB_FATAL, MSGTR_NEEDLAVC);
             return False;
         }
-#endif
 
         break;
 
@@ -799,14 +768,12 @@ int gui(int what, void *data)
             break;
         }
 
-#ifdef CONFIG_CDDA
         if (guiInfo.StreamType == STREAMTYPE_CDDA) {
             uiNext();
 
             if (guiInfo.Playing)
                 break;
         }
-#endif
 
         if (guiInfo.Playing && (next = listSet(gtkGetNextPlItem, NULL)) && (plLastPlayed != next)) {
             plLastPlayed = next;
@@ -823,11 +790,9 @@ int gui(int what, void *data)
             guiInfo.Position      = 0;
             guiInfo.AudioChannels = 0;
 
-#ifdef CONFIG_DVDREAD
             guiInfo.Track   = 1;
             guiInfo.Chapter = 1;
             guiInfo.Angle   = 1;
-#endif
 
             if (gtkShowVideoWindow) {
                 guiInfo.VideoWindow = True;
@@ -970,12 +935,11 @@ void mplayer(int what, float value, void
     switch (what) {
         // subtitle
 
-#ifndef CONFIG_FREETYPE
     case MPLAYER_SET_FONT_FACTOR:
         font_factor = value;
         mplayerLoadFont();
         break;
-#else
+
     case MPLAYER_SET_FONT_OUTLINE:
         subtitle_font_thickness = (8.0f / 100.0f) * value;
         mplayerLoadFont();
@@ -1006,14 +970,11 @@ void mplayer(int what, float value, void
         subtitle_autoscale = (int)value;
         mplayerLoadFont();
         break;
-#endif
 
-#ifdef CONFIG_ICONV
     case MPLAYER_SET_SUB_ENCODING:
         nfree(sub_cp);
         sub_cp = gstrdup((char *)data);
         break;
-#endif
 
     case MPLAYER_SET_EXTRA_STEREO:
         gtkAOExtraStereoMul = value;

Modified: trunk/gui/interface.h
==============================================================================
--- trunk/gui/interface.h	Thu Jan 12 11:07:22 2012	(r34541)
+++ trunk/gui/interface.h	Thu Jan 12 11:08:25 2012	(r34542)
@@ -102,30 +102,22 @@ typedef struct {
     int StreamType;
     int AudioChannels;
 
-#ifdef CONFIG_DVDREAD
     int AudioStreams;
     stream_language_t AudioStream[32];
 
     int Subtitles;
     stream_language_t Subtitle[32];
-#endif
 
     char *Filename;           // public, read access by MPlayer
     char *AudioFilename;
     char *SubtitleFilename;
 
-#if defined(CONFIG_VCD) || defined(CONFIG_DVDREAD)
     int Tracks;
-#endif
-
     int Track;                // public, read access by MPlayer
-
-#ifdef CONFIG_DVDREAD
     int Chapters;
     int Chapter;              // public, write access by MPlayer
     int Angles;
     int Angle;
-#endif
 
     int Playing;              // public, read access by MPlayer
 

Modified: trunk/gui/ui/actions.c
==============================================================================
--- trunk/gui/ui/actions.c	Thu Jan 12 11:07:22 2012	(r34541)
+++ trunk/gui/ui/actions.c	Thu Jan 12 11:08:25 2012	(r34542)
@@ -247,20 +247,10 @@ void uiCurr(void)
         return;
 
     switch (guiInfo.StreamType) {
-#ifdef CONFIG_CDDA
     case STREAMTYPE_CDDA:
-        break;
-#endif
-
-#ifdef CONFIG_VCD
     case STREAMTYPE_VCD:
-        break;
-#endif
-
-#ifdef CONFIG_DVDREAD
     case STREAMTYPE_DVD:
         break;
-#endif
 
     default:
 
@@ -291,25 +281,20 @@ void uiPrev(void)
         return;
 
     switch (guiInfo.StreamType) {
-#ifdef CONFIG_CDDA
     case STREAMTYPE_CDDA:
         if (--guiInfo.Track == 0) {
             guiInfo.Track = 1;
             stop = 1;
         }
         break;
-#endif
 
-#ifdef CONFIG_VCD
     case STREAMTYPE_VCD:
         if (--guiInfo.Track == 1) {
             guiInfo.Track = 2;
             stop = 1;
         }
         break;
-#endif
 
-#ifdef CONFIG_DVDREAD
     case STREAMTYPE_DVD:
 
         if (--guiInfo.Chapter == 0) {
@@ -322,7 +307,6 @@ void uiPrev(void)
         }
 
         break;
-#endif
 
     default:
 
@@ -354,7 +338,6 @@ void uiNext(void)
         return;
 
     switch (guiInfo.StreamType) {
-#ifdef CONFIG_CDDA
     case STREAMTYPE_CDDA:
 
         if (++guiInfo.Track > guiInfo.Tracks) {
@@ -363,9 +346,7 @@ void uiNext(void)
         }
 
         break;
-#endif
 
-#ifdef CONFIG_VCD
     case STREAMTYPE_VCD:
 
         if (++guiInfo.Track >= guiInfo.Tracks) {
@@ -374,9 +355,7 @@ void uiNext(void)
         }
 
         break;
-#endif
 
-#ifdef CONFIG_DVDREAD
     case STREAMTYPE_DVD:
 
         if (guiInfo.Chapter++ == guiInfo.Chapters) {
@@ -389,7 +368,6 @@ void uiNext(void)
         }
 
         break;
-#endif
 
     default:
 

Modified: trunk/gui/ui/gtk/menu.c
==============================================================================
--- trunk/gui/ui/gtk/menu.c	Thu Jan 12 11:07:22 2012	(r34541)
+++ trunk/gui/ui/gtk/menu.c	Thu Jan 12 11:08:25 2012	(r34542)
@@ -207,6 +207,7 @@ typedef struct
  const char * name;
 } Languages_t;
 
+#ifdef CONFIG_DVDREAD
 #define lng( a,b ) ( (int)(a) * 256 + b )
 static Languages_t Languages[] =
          {
@@ -384,12 +385,10 @@ static Languages_t Languages[] =
          };
 #undef lng
 
-#ifdef CONFIG_DVDREAD
 static char * ChannelTypes[] =
 	{ "Dolby Digital","","Mpeg1","Mpeg2","PCM","","Digital Theatre System" };
 static char * ChannelNumbers[] =
 	{ "","Stereo","","","","5.1" };
-#endif
 
 static const char * GetLanguage( int language )
 {
@@ -398,6 +397,7 @@ static const char * GetLanguage( int lan
   if ( Languages[i].id == language ) return Languages[i].name;
  return NULL;
 }
+#endif
 
 
 GtkWidget * DVDSubMenu;

Modified: trunk/gui/ui/gtk/preferences.c
==============================================================================
--- trunk/gui/ui/gtk/preferences.c	Thu Jan 12 11:07:22 2012	(r34541)
+++ trunk/gui/ui/gtk/preferences.c	Thu Jan 12 11:08:25 2012	(r34542)
@@ -184,10 +184,8 @@ static char * ao_driver[3];
 static char * vo_driver[3];
 static int    old_video_driver = 0;
 
-#ifdef CONFIG_DXR3
  void ShowDXR3Config( void );
  void HideDXR3Config( void );
-#endif
  void ShowAudioConfig( void );
  void HideAudioConfig( void );
 
@@ -1474,6 +1472,7 @@ static GList *appendESDDevices(GList *l)
 }
 #endif
 
+#if defined(CONFIG_OSS_AUDIO) || defined(CONFIG_ALSA) || defined(CONFIG_SDL) || defined (CONFIG_ESD)
 // Gets text string from a gtk entry, interpreting
 // MSGTR_PREFERENCES_DriverDefault as null string.
 static const char *getGtkEntryText(GtkWidget *from)
@@ -1494,6 +1493,7 @@ static void setGtkEntryText(GtkWidget *d
   }
   gtk_entry_set_text(GTK_ENTRY(dest),to);
 }
+#endif
 
        GtkWidget *AudioConfig;
 static GtkWidget *CEAudioDevice;
@@ -1706,7 +1706,6 @@ GtkWidget *create_AudioConfig( void ) {
   return AudioConfig;
 }
 
-#ifdef CONFIG_DXR3
 // --- dxr3 config box
 
 static GtkWidget * DXR3Config;
@@ -1826,5 +1825,3 @@ GtkWidget * create_DXR3Config( void )
 
  return DXR3Config;
 }
-
-#endif

Modified: trunk/gui/ui/main.c
==============================================================================
--- trunk/gui/ui/main.c	Thu Jan 12 11:07:22 2012	(r34541)
+++ trunk/gui/ui/main.c	Thu Jan 12 11:08:25 2012	(r34542)
@@ -114,11 +114,8 @@ static void guiInfoMediumClear (int what
     listSet(gtkDelPl, NULL);
   }
 
-#ifdef CONFIG_VCD
   if (what & CLEAR_VCD) guiInfo.Tracks = 0;
-#endif
 
-#ifdef CONFIG_DVDREAD
   if (what & CLEAR_DVD)
   {
     guiInfo.AudioStreams = 0;
@@ -127,7 +124,6 @@ static void guiInfoMediumClear (int what
     guiInfo.Chapters = 0;
     guiInfo.Angles = 0;
   }
-#endif
 }
 
 static unsigned last_redraw_time = 0;
@@ -228,7 +224,7 @@ play:
 	         guiInfo.Track=1;
 	       guiInfo.NewPlay=GUI_FILE_NEW;
 	       break;
-#ifdef CONFIG_CDDA
+
           case STREAMTYPE_CDDA:
 	       guiInfoMediumClear( CLEAR_ALL - CLEAR_VCD - CLEAR_FILE );
 	       if ( guiInfo.Playing != GUI_PAUSE )
@@ -238,8 +234,7 @@ play:
                  guiInfo.NewPlay=GUI_FILE_SAME;
 		}
 	       break;
-#endif
-#ifdef CONFIG_VCD
+
           case STREAMTYPE_VCD:
 	       guiInfoMediumClear( CLEAR_ALL - CLEAR_VCD - CLEAR_FILE );
 	       if ( guiInfo.Playing != GUI_PAUSE )
@@ -249,8 +244,7 @@ play:
                  guiInfo.NewPlay=GUI_FILE_SAME;
 		}
 	       break;
-#endif
-#ifdef CONFIG_DVDREAD
+
           case STREAMTYPE_DVD:
 	       guiInfoMediumClear( CLEAR_ALL - CLEAR_DVD - CLEAR_FILE );
 	       if ( guiInfo.Playing != GUI_PAUSE )
@@ -258,7 +252,6 @@ play:
                  guiInfo.NewPlay=GUI_FILE_SAME;
 		}
                break;
-#endif
          }
         uiPlay();
         break;

Modified: trunk/gui/ui/render.c
==============================================================================
--- trunk/gui/ui/render.c	Thu Jan 12 11:07:22 2012	(r34541)
+++ trunk/gui/ui/render.c	Thu Jan 12 11:08:25 2012	(r34542)
@@ -206,23 +206,17 @@ calclengthmmmmss:
                     av_strlcat(trbuf, "u", sizeof(trbuf));
                     break;
 
-#ifdef CONFIG_CDDA
                 case STREAMTYPE_CDDA:
                     av_strlcat(trbuf, "a", sizeof(trbuf));
                     break;
-#endif
 
-#ifdef CONFIG_VCD
                 case STREAMTYPE_VCD:
                     av_strlcat(trbuf, "v", sizeof(trbuf));
                     break;
-#endif
 
-#ifdef CONFIG_DVDREAD
                 case STREAMTYPE_DVD:
                     av_strlcat(trbuf, "d", sizeof(trbuf));
                     break;
-#endif
 
                 default:
                     av_strlcat(trbuf, " ", sizeof(trbuf));

Modified: trunk/gui/util/string.c
==============================================================================
--- trunk/gui/util/string.c	Thu Jan 12 11:07:22 2012	(r34541)
+++ trunk/gui/util/string.c	Thu Jan 12 11:08:25 2012	(r34542)
@@ -283,26 +283,20 @@ char *TranslateFilename(int how, char *f
         av_strlcpy(fname, guiInfo.Filename, maxlen);
         break;
 
-#ifdef CONFIG_CDDA
     case STREAMTYPE_CDDA:
         snprintf(fname, maxlen, MSGTR_Title, guiInfo.Track);
         break;
-#endif
 
-#ifdef CONFIG_VCD
     case STREAMTYPE_VCD:
         snprintf(fname, maxlen, MSGTR_Title, guiInfo.Track - 1);
         break;
-#endif
 
-#ifdef CONFIG_DVDREAD
     case STREAMTYPE_DVD:
         if (guiInfo.Chapter)
             snprintf(fname, maxlen, MSGTR_Chapter, guiInfo.Chapter);
         else
             av_strlcat(fname, MSGTR_NoChapter, maxlen);
         break;
-#endif
 
     default:
         av_strlcpy(fname, MSGTR_NoMediaOpened, maxlen);

Modified: trunk/gui/win32/dialogs.c
==============================================================================
--- trunk/gui/win32/dialogs.c	Thu Jan 12 11:07:22 2012	(r34541)
+++ trunk/gui/win32/dialogs.c	Thu Jan 12 11:08:25 2012	(r34542)
@@ -774,7 +774,6 @@ void display_skinbrowser(gui_t* gui)
    UpdateWindow(hWnd);
 }
 
-#ifdef CONFIG_DVDREAD
 static LRESULT CALLBACK TitleChapterWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
 {
     static HWND title;
@@ -902,7 +901,6 @@ void display_chapterselwindow(gui_t *gui
    ShowWindow(hWnd, SW_SHOW);
    UpdateWindow(hWnd);
 }
-#endif
 
 static LRESULT CALLBACK EqWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
 {

Modified: trunk/gui/win32/gui.c
==============================================================================
--- trunk/gui/win32/gui.c	Thu Jan 12 11:07:22 2012	(r34541)
+++ trunk/gui/win32/gui.c	Thu Jan 12 11:08:25 2012	(r34542)
@@ -451,11 +451,9 @@ static LRESULT CALLBACK SubProc(HWND hWn
                 case ID_NTRACK:
                     handlemsg(hWnd, evNext);
                     break;
-#ifdef CONFIG_DVDREAD
                 case ID_CHAPTERSEL:
                     display_chapterselwindow(gui);
                     break;
-#endif
                 case ID_FULLSCREEN:
                     mp_input_queue_cmd(mp_input_parse_cmd("vo_fullscreen"));
                     break;
@@ -864,9 +862,11 @@ static LRESULT CALLBACK EventProc(HWND h
                     char menuitem[MAX_PATH];
                     int flags = MF_STRING, enable = 0;
                     mp_msg(MSGT_GPLAYER, MSGL_V, "[GUI] checking %s for CD/VCD/SVCD/DVDs\n", device + pos);
+#ifdef CONFIG_DVDREAD
                     sprintf(searchpath, "%sVIDEO_TS", device + pos);
                     if(GetFileAttributes(searchpath) != INVALID_FILE_ATTRIBUTES)
                         enable = 1;
+#endif
                     sprintf(searchpath, "%sMpegav", device + pos);
                     if(GetFileAttributes(searchpath) != INVALID_FILE_ATTRIBUTES)
                         enable = 1;
@@ -1045,22 +1045,18 @@ static LRESULT CALLBACK EventProc(HWND h
                             sprintf(searchpath, "%sVIDEO_TS", device + pos);
                             if(GetFileAttributes(searchpath) != INVALID_FILE_ATTRIBUTES)
                             {
-#ifdef CONFIG_DVDREAD
                                 free(dvd_device);
                                 dvd_device = strdup(device + pos);
                                 handlemsg(hWnd, evPlayDVD);
-#endif
                             }
                             sprintf(searchpath, "%sTrack01.cda", device + pos);
                             if(GetFileAttributes(searchpath) != INVALID_FILE_ATTRIBUTES)
                             {
-#ifdef CONFIG_CDDA
                                 free(cdrom_device);
                                 cdrom_device = strdup(device + pos);
                                 /* mplayer doesn't seem to like the trailing \ after the device name */
                                 cdrom_device[2]=0;
                                 handlemsg(hWnd, evPlayCD);
-#endif
                             } else {
                                 HANDLE searchhndl;
                                 WIN32_FIND_DATA finddata;
@@ -1250,8 +1246,8 @@ static void create_submenu(gui_t *gui)
     AppendMenu(gui->submenu, MF_SEPARATOR, 0, 0);
     AppendMenu(gui->submenu, MF_STRING | MF_POPUP, (UINT_PTR) gui->aspectmenu, acp(MSGTR_MENU_AspectRatio));
     AppendMenu(gui->submenu, MF_STRING | MF_POPUP, (UINT_PTR) gui->subtitlemenu, acp(MSGTR_MENU_Subtitles));
-    AppendMenu(gui->submenu, MF_STRING | MF_POPUP, (UINT_PTR) gui->dvdmenu, acp(MSGTR_MENU_DVD));
 #ifdef CONFIG_DVDREAD
+    AppendMenu(gui->submenu, MF_STRING | MF_POPUP, (UINT_PTR) gui->dvdmenu, acp(MSGTR_MENU_DVD));
     AppendMenu(gui->dvdmenu, MF_STRING | MF_GRAYED, ID_CHAPTERSEL, acp(MSGTR_SelectTitleChapter));
 #endif
     AppendMenu(gui->subtitlemenu, MF_STRING, IDSUB_TOGGLE, acp(MSGTR_MENU_SubtitlesOnOff));

Modified: trunk/gui/win32/interface.c
==============================================================================
--- trunk/gui/win32/interface.c	Thu Jan 12 11:07:22 2012	(r34541)
+++ trunk/gui/win32/interface.c	Thu Jan 12 11:08:25 2012	(r34542)
@@ -354,14 +354,12 @@ static void guiSetEvent(int event)
         {
             switch(guiInfo.StreamType)
             {
-#ifdef CONFIG_DVDREAD
                 case STREAMTYPE_DVD:
                 {
                     guiInfo.NewPlay = GUI_FILE_SAME;
                     gui(GUI_SET_STATE, (void *) GUI_PLAY);
                     break;
                 }
-#endif
                 default:
                 {
                     guiInfo.NewPlay = GUI_FILE_NEW;
@@ -415,13 +413,11 @@ void uiNext(void)
     if(guiInfo.Playing == GUI_PAUSE) return;
     switch(guiInfo.StreamType)
     {
-#ifdef CONFIG_DVDREAD
         case STREAMTYPE_DVD:
             if(guiInfo.Chapter == (guiInfo.Chapters - 1))
                 return;
             guiInfo.Chapter++;
             break;
-#endif
         default:
             if(mygui->playlist->current == (mygui->playlist->trackcount - 1))
                 return;
@@ -437,13 +433,11 @@ void uiPrev(void)
     if(guiInfo.Playing == GUI_PAUSE) return;
     switch(guiInfo.StreamType)
     {
-#ifdef CONFIG_DVDREAD
         case STREAMTYPE_DVD:
             if(guiInfo.Chapter == 1)
                 return;
             guiInfo.Chapter--;
             break;
-#endif
         default:
             if(mygui->playlist->current == 0)
                 return;
@@ -596,7 +590,6 @@ int gui(int what, void *data)
                     uiSetFileName(NULL, mygui->playlist->tracks[mygui->playlist->current]->filename, SAME_STREAMTYPE);
                     guiInfo.Track = mygui->playlist->current + 1;
                     break;
-#ifdef CONFIG_DVDREAD
                 case STREAMTYPE_DVD:
                 {
                     char tmp[512];
@@ -606,7 +599,6 @@ int gui(int what, void *data)
                     uiSetFileName(NULL, tmp, SAME_STREAMTYPE);
                     break;
                 }
-#endif
             }
             guiInfo.VideoWindow = 1;
             if(gtkAONorm) greplace(&af_cfg.list, "volnorm", "volnorm");
@@ -665,7 +657,6 @@ int gui(int what, void *data)
             guiInfo.StreamType = stream->type;
             switch(stream->type)
             {
-#ifdef CONFIG_DVDREAD
                 case STREAMTYPE_DVD:
                     guiInfo.Tracks = 0;
                     stream_control(stream, STREAM_CTRL_GET_NUM_TITLES, &guiInfo.Tracks);
@@ -673,16 +664,17 @@ int gui(int what, void *data)
                     stream_control(stream, STREAM_CTRL_GET_NUM_CHAPTERS, &guiInfo.Chapters);
                     guiInfo.Angles = 0;
                     stream_control(stream, STREAM_CTRL_GET_NUM_ANGLES, &guiInfo.Angles);
+#ifdef CONFIG_DVDREAD
                     dvdp = stream->priv;
                     guiInfo.AudioStreams = dvdp->nr_of_channels;
                     memcpy(guiInfo.AudioStream, dvdp->audio_streams, sizeof(dvdp->audio_streams));
                     guiInfo.Subtitles = dvdp->nr_of_subtitles;
                     memcpy(guiInfo.Subtitle, dvdp->subtitles, sizeof(dvdp->subtitles));
+#endif
                     guiInfo.Chapter = dvd_chapter + 1;
                     guiInfo.Angle = dvd_angle + 1;
                     guiInfo.Track = dvd_title + 1;
                     break;
-#endif
             }
             break;
         }
@@ -796,11 +788,9 @@ int gui(int what, void *data)
           guiInfo.Position = 0;
           guiInfo.AudioChannels = 0;
 
-#ifdef CONFIG_DVDREAD
           guiInfo.Track = 1;
           guiInfo.Chapter = 1;
           guiInfo.Angle = 1;
-#endif
 
           if (mygui->playlist->current == (mygui->playlist->trackcount - 1))
               mygui->playlist->current = 0;

Modified: trunk/gui/win32/widgetrender.c
==============================================================================
--- trunk/gui/win32/widgetrender.c	Thu Jan 12 11:07:22 2012	(r34541)
+++ trunk/gui/win32/widgetrender.c	Thu Jan 12 11:08:25 2012	(r34542)
@@ -163,10 +163,8 @@ static char *generatetextfromlabel(widge
 
     if(guiInfo.StreamType == 0)
         stringreplace(text, "$T", "f");
-#ifdef CONFIG_DVDREAD
     else if(guiInfo.StreamType == STREAMTYPE_DVD || guiInfo.StreamType == STREAMTYPE_DVDNAV)
         stringreplace(text, "$T", "d");
-#endif
     else stringreplace(text, "$T", "u");
 
     stringreplace(text, "$f", acp(TranslateFilename(1, tmp, sizeof(tmp))));

Modified: trunk/gui/wm/ws.c
==============================================================================
--- trunk/gui/wm/ws.c	Thu Jan 12 11:07:22 2012	(r34541)
+++ trunk/gui/wm/ws.c	Thu Jan 12 11:08:25 2012	(r34542)
@@ -325,7 +325,6 @@ void wsXInit(Display *mDisplay)
     mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[ws]  green mask: 0x%x\n", wsGreenMask);
     mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[ws]  blue mask: 0x%x\n", wsBlueMask);
 
-#ifdef MP_DEBUG
     if (wsUseXShm) {
         int minor, major, shp;
 
@@ -341,7 +340,6 @@ void wsXInit(Display *mDisplay)
         mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[ws] XShape version is %d.%d\n", major, minor);
     }
 #endif
-#endif
 
     wsOutMask = wsGetOutMask();
 


More information about the MPlayer-cvslog mailing list