# HG changeset patch # User ib # Date 1350562678 0 # Node ID ade40c1d69b8ec182436145f67d83635d45f8004 # Parent a78e2453e188d34ca1fca4a78e10b091d8e9702f 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). diff -r a78e2453e188 -r ade40c1d69b8 gui/interface.c --- 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; diff -r a78e2453e188 -r ade40c1d69b8 gui/win32/dialogs.c --- 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; jplaylist->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; diff -r a78e2453e188 -r ade40c1d69b8 stream/open.c --- 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) diff -r a78e2453e188 -r ade40c1d69b8 stream/stream.h --- 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; diff -r a78e2453e188 -r ade40c1d69b8 stream/stream_dvd.c --- 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))