diff gui/win32/interface.c @ 35168:627bdd8915ca

Fix building GUI without DVD support. The (global) configuration variables dvd_chapter and dvd_angle must be set prior to opening the stream and as there isn't yet a stream available, no stream control command can be used. After the stream has been opened, the angle can be retrieved by a stream control command and variable access can be avoided. Additionally, don't set guiInfo.Chapter - and wrongly by one -, because this will be done in mplayer.c, after the chapter has been seeked (later). Reported by Valentine Barshak, gvaxon gmail com.
author ib
date Sun, 21 Oct 2012 14:40:49 +0000
parents ade40c1d69b8
children 6f214e8ae780
line wrap: on
line diff
--- a/gui/win32/interface.c	Sun Oct 21 12:18:58 2012 +0000
+++ b/gui/win32/interface.c	Sun Oct 21 14:40:49 2012 +0000
@@ -592,8 +592,10 @@
                 case STREAMTYPE_DVD:
                 {
                     char tmp[512];
+#ifdef CONFIG_DVDREAD
                     dvd_chapter = guiInfo.Chapter;
                     dvd_angle = guiInfo.Angle;
+#endif
                     sprintf(tmp,"dvd://%d", guiInfo.Track);
                     uiSetFileName(NULL, tmp, SAME_STREAMTYPE);
                     break;
@@ -663,6 +665,9 @@
                     stream_control(stream, STREAM_CTRL_GET_NUM_CHAPTERS, &guiInfo.Chapters);
                     guiInfo.Angles = 0;
                     stream_control(stream, STREAM_CTRL_GET_NUM_ANGLES, &guiInfo.Angles);
+                    // guiInfo.Chapter will be set by mplayer
+                    guiInfo.Angle = 1;
+                    stream_control(stream, STREAM_CTRL_GET_ANGLE, &guiInfo.Angle);
 #ifdef CONFIG_DVDREAD
                     dvdp = stream->priv;
                     guiInfo.AudioStreams = dvdp->nr_of_channels;
@@ -670,8 +675,6 @@
                     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;
                     break;
             }
             break;