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

ib subversion at mplayerhq.hu
Fri Nov 29 14:10:31 CET 2013


Author: ib
Date: Fri Nov 29 14:10:31 2013
New Revision: 36526

Log:
Don't discard current DVD track information without cause.

In case STREAM_CTRL_GET_CURRENT_TITLE fails, use the information the
GUI already has (though it might be inaccurate in extremely rare cases).

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

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Fri Nov 29 13:41:32 2013	(r36525)
+++ trunk/gui/interface.c	Fri Nov 29 14:10:31 2013	(r36526)
@@ -628,9 +628,8 @@ 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.Track = 0;
-            stream_control(stream, STREAM_CTRL_GET_CURRENT_TITLE, &guiInfo.Track);
-            guiInfo.Track++;
+            if (stream_control(stream, STREAM_CTRL_GET_CURRENT_TITLE, &guiInfo.Track) == STREAM_OK)
+                guiInfo.Track++;
             // guiInfo.Chapter will be set by mplayer
             guiInfo.Angle = 1;
             stream_control(stream, STREAM_CTRL_GET_ANGLE, &guiInfo.Angle);

Modified: trunk/gui/win32/interface.c
==============================================================================
--- trunk/gui/win32/interface.c	Fri Nov 29 13:41:32 2013	(r36525)
+++ trunk/gui/win32/interface.c	Fri Nov 29 14:10:31 2013	(r36526)
@@ -664,9 +664,8 @@ 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.Track = 0;
-                    stream_control(stream, STREAM_CTRL_GET_CURRENT_TITLE, &guiInfo.Track);
-                    guiInfo.Track++;
+                    if (stream_control(stream, STREAM_CTRL_GET_CURRENT_TITLE, &guiInfo.Track) == STREAM_OK)
+                        guiInfo.Track++;
                     // guiInfo.Chapter will be set by mplayer
                     guiInfo.Angle = 1;
                     stream_control(stream, STREAM_CTRL_GET_ANGLE, &guiInfo.Angle);


More information about the MPlayer-cvslog mailing list