Mercurial > mplayer.hg
comparison gui/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 |
comparison
equal
deleted
inserted
replaced
35167:f2b81cd25817 | 35168:627bdd8915ca |
---|---|
435 char tmp[512]; | 435 char tmp[512]; |
436 | 436 |
437 sprintf(tmp, "dvd://%d", guiInfo.Track); | 437 sprintf(tmp, "dvd://%d", guiInfo.Track); |
438 uiSetFileName(NULL, tmp, SAME_STREAMTYPE); | 438 uiSetFileName(NULL, tmp, SAME_STREAMTYPE); |
439 } | 439 } |
440 | 440 #ifdef CONFIG_DVDREAD |
441 dvd_chapter = guiInfo.Chapter; | 441 dvd_chapter = guiInfo.Chapter; |
442 dvd_angle = guiInfo.Angle; | 442 dvd_angle = guiInfo.Angle; |
443 | 443 #endif |
444 break; | 444 break; |
445 } | 445 } |
446 | 446 |
447 /* video opts */ | 447 /* video opts */ |
448 | 448 |
620 stream_control(stream, STREAM_CTRL_GET_NUM_TITLES, &guiInfo.Tracks); | 620 stream_control(stream, STREAM_CTRL_GET_NUM_TITLES, &guiInfo.Tracks); |
621 guiInfo.Chapters = 0; | 621 guiInfo.Chapters = 0; |
622 stream_control(stream, STREAM_CTRL_GET_NUM_CHAPTERS, &guiInfo.Chapters); | 622 stream_control(stream, STREAM_CTRL_GET_NUM_CHAPTERS, &guiInfo.Chapters); |
623 guiInfo.Angles = 0; | 623 guiInfo.Angles = 0; |
624 stream_control(stream, STREAM_CTRL_GET_NUM_ANGLES, &guiInfo.Angles); | 624 stream_control(stream, STREAM_CTRL_GET_NUM_ANGLES, &guiInfo.Angles); |
625 // guiInfo.Chapter will be set by mplayer | |
626 guiInfo.Angle = 1; | |
627 stream_control(stream, STREAM_CTRL_GET_ANGLE, &guiInfo.Angle); | |
625 #ifdef CONFIG_DVDREAD | 628 #ifdef CONFIG_DVDREAD |
626 dvd = stream->priv; | 629 dvd = stream->priv; |
627 guiInfo.AudioStreams = dvd->nr_of_channels; | 630 guiInfo.AudioStreams = dvd->nr_of_channels; |
628 memcpy(guiInfo.AudioStream, dvd->audio_streams, sizeof(dvd->audio_streams)); | 631 memcpy(guiInfo.AudioStream, dvd->audio_streams, sizeof(dvd->audio_streams)); |
629 guiInfo.Subtitles = dvd->nr_of_subtitles; | 632 guiInfo.Subtitles = dvd->nr_of_subtitles; |
630 memcpy(guiInfo.Subtitle, dvd->subtitles, sizeof(dvd->subtitles)); | 633 memcpy(guiInfo.Subtitle, dvd->subtitles, sizeof(dvd->subtitles)); |
631 #endif | 634 #endif |
632 guiInfo.Chapter = dvd_chapter + 1; | |
633 guiInfo.Angle = dvd_angle + 1; | |
634 break; | 635 break; |
635 } | 636 } |
636 | 637 |
637 break; | 638 break; |
638 | 639 |