Fixed several bugs related to detached video display.

Originally committed to SVN as r884.
This commit is contained in:
Rodrigo Braz Monteiro 2007-01-23 06:44:08 +00:00
parent 8231034cb1
commit 83cdb12457

View file

@ -719,12 +719,17 @@ int FrameMain::TryToCloseSubs(bool enableCancel) {
////////////////////
// Set display mode
void FrameMain::SetDisplayMode(int _showVid,int _showAudio) {
// Shown?
static bool firstRun = true;
if (!IsShownOnScreen() && !firstRun) return;
firstRun = false;
// Stop
Freeze();
VideoContext::Get()->Stop();
// Automatic
if (_showVid == -1) _showVid = VideoContext::Get()->IsLoaded() ? 1 : 0;
if (_showVid == -1) _showVid = (VideoContext::Get()->IsLoaded() && !detachedVideo) ? 1 : 0;
if (_showAudio == -1) _showAudio = audioBox->loaded ? 1 : 0;
// See if anything changed