# HG changeset patch # User ib # Date 1350830449 0 # Node ID 627bdd8915caeb726cd817d154b892656264c4c2 # Parent f2b81cd2581712944cf7ee557abda380d1b809ed 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. diff -r f2b81cd25817 -r 627bdd8915ca gui/interface.c --- a/gui/interface.c Sun Oct 21 12:18:58 2012 +0000 +++ b/gui/interface.c Sun Oct 21 14:40:49 2012 +0000 @@ -437,10 +437,10 @@ 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 @@ 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 @@ 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; } diff -r f2b81cd25817 -r 627bdd8915ca gui/win32/interface.c --- 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;