[MPlayer-cvslog] r35262 - in trunk/gui: interface.c win32/interface.c

ib subversion at mplayerhq.hu
Sun Oct 21 16:40:49 CEST 2012


Author: ib
Date: Sun Oct 21 16:40:49 2012
New Revision: 35262

Log:
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.

Modified:
   trunk/gui/interface.c
   trunk/gui/win32/interface.c

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Sun Oct 21 14:18:58 2012	(r35261)
+++ trunk/gui/interface.c	Sun Oct 21 16:40:49 2012	(r35262)
@@ -437,10 +437,10 @@ int gui(int what, void *data)
             sprintf(tmp, "dvd://%d", guiInfo.Track);
             uiSetFileName(NULL, tmp, SAME_STREAMTYPE);
         }
-
+#ifdef CONFIG_DVDREAD
             dvd_chapter = guiInfo.Chapter;
             dvd_angle   = guiInfo.Angle;
-
+#endif
             break;
         }
 
@@ -622,6 +622,9 @@ 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);
+            // guiInfo.Chapter will be set by mplayer
+            guiInfo.Angle = 1;
+            stream_control(stream, STREAM_CTRL_GET_ANGLE, &guiInfo.Angle);
 #ifdef CONFIG_DVDREAD
             dvd = stream->priv;
             guiInfo.AudioStreams = dvd->nr_of_channels;
@@ -629,8 +632,6 @@ int gui(int what, void *data)
             guiInfo.Subtitles = dvd->nr_of_subtitles;
             memcpy(guiInfo.Subtitle, dvd->subtitles, sizeof(dvd->subtitles));
 #endif
-            guiInfo.Chapter = dvd_chapter + 1;
-            guiInfo.Angle   = dvd_angle + 1;
             break;
         }
 

Modified: trunk/gui/win32/interface.c
==============================================================================
--- trunk/gui/win32/interface.c	Sun Oct 21 14:18:58 2012	(r35261)
+++ trunk/gui/win32/interface.c	Sun Oct 21 16:40:49 2012	(r35262)
@@ -592,8 +592,10 @@ int gui(int what, void *data)
                 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 @@ 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);
+                    // 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 @@ int gui(int what, void *data)
                     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;


More information about the MPlayer-cvslog mailing list