changeset 35159:ade40c1d69b8

Get rid of global variable dvd_title in GUI. Its usage is pointless anyway, because the GUI uses guiInfo.Track instead. As a result, it doesn't have to be global any longer and can be defined in stream/stream_dvd.c (where it belongs).
author ib
date Thu, 18 Oct 2012 12:17:58 +0000
parents a78e2453e188
children bbcd42f7f0af
files gui/interface.c gui/win32/dialogs.c gui/win32/interface.c stream/open.c stream/stream.h stream/stream_dvd.c
diffstat 6 files changed, 2 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/gui/interface.c	Thu Oct 18 12:07:59 2012 +0000
+++ b/gui/interface.c	Thu Oct 18 12:17:58 2012 +0000
@@ -397,7 +397,6 @@
         wsVisibleMouse(&guiApp.videoWindow, wsHideMouseCursor);
 
         if (guiInfo.NewPlay == GUI_FILE_NEW) {
-            dvd_title = 0;
             audio_id  = -1;
             video_id  = -1;
             dvdsub_id = -1;
@@ -630,7 +629,6 @@
             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;
--- a/gui/win32/dialogs.c	Thu Oct 18 12:07:59 2012 +0000
+++ b/gui/win32/dialogs.c	Thu Oct 18 12:17:58 2012 +0000
@@ -827,7 +827,7 @@
                 sprintf(&titles[i], "%d", guiInfo.Tracks - i);
                 SendDlgItemMessage(hwnd, ID_TITLESEL, CB_INSERTSTRING, 0, (LPARAM) &titles[i]);
             }
-            SendDlgItemMessage(hwnd, ID_TITLESEL, CB_SETCURSEL, dvd_title, 0);
+            SendDlgItemMessage(hwnd, ID_TITLESEL, CB_SETCURSEL, guiInfo.Track - 1, 0);
 
             for (j=0; j<guiInfo.Chapters; j++)
             {
--- a/gui/win32/interface.c	Thu Oct 18 12:07:59 2012 +0000
+++ b/gui/win32/interface.c	Thu Oct 18 12:17:58 2012 +0000
@@ -580,7 +580,6 @@
             vobsub_id = -1;
             stream_cache_size = -1;
             autosync = 0;
-            dvd_title = 0;
             force_fps = 0;
             if(!mygui->playlist->tracks) return 0;
             switch(guiInfo.StreamType)
@@ -673,7 +672,6 @@
 #endif
                     guiInfo.Chapter = dvd_chapter + 1;
                     guiInfo.Angle = dvd_angle + 1;
-                    guiInfo.Track = dvd_title + 1;
                     break;
             }
             break;
--- a/stream/open.c	Thu Oct 18 12:07:59 2012 +0000
+++ b/stream/open.c	Thu Oct 18 12:17:58 2012 +0000
@@ -42,7 +42,6 @@
 int dvd_chapter=1;
 int dvd_last_chapter=0;
 char* dvd_device=NULL;
-int dvd_title=0;
 char *bluray_device=NULL;
 
 // Open a new stream  (stdin/file/vcd/url)
--- a/stream/stream.h	Thu Oct 18 12:07:59 2012 +0000
+++ b/stream/stream.h	Thu Oct 18 12:17:58 2012 +0000
@@ -379,7 +379,6 @@
 extern int bluray_angle;
 extern int bluray_chapter;
 extern int dvd_speed;
-extern int dvd_title;
 extern int dvd_chapter;
 extern int dvd_last_chapter;
 extern int dvd_angle;
--- a/stream/stream_dvd.c	Thu Oct 18 12:07:59 2012 +0000
+++ b/stream/stream_dvd.c	Thu Oct 18 12:17:58 2012 +0000
@@ -44,6 +44,7 @@
 #include "libmpdemux/demuxer.h"
 
 static char* dvd_device_current;
+static int dvd_title;
 int dvd_angle=1;
 
 #define	LIBDVDREAD_VERSION(maj,min,micro)	((maj)*10000 + (min)*100 + (micro))