Fix a xine race condition on win32 by showing the debug console :S

This commit is contained in:
David Sansome 2010-02-14 20:08:24 +00:00
parent 7eb2c396e4
commit 14445f03b0
4 changed files with 22 additions and 7 deletions

View File

@ -1,3 +1,9 @@
#ifdef Q_OS_WIN32
# define _WIN32_WINNT 0x0500
# include <windows.h>
# include <iostream>
#endif // Q_OS_WIN32
#include "mainwindow.h"
#include "directory.h"
#include "song.h"
@ -23,6 +29,12 @@ int main(int argc, char *argv[]) {
// Couldn't send the message so start anyway
}
#ifdef Q_OS_WIN32
// CONFIG += console seems to fix a race condition in xine. God knows why :/
// Hide the console window here so it doen't annoy the user.
ShowWindow( GetConsoleWindow(), SW_HIDE );
#endif // Q_OS_WIN32
MainWindow w;
a.setActivationWindow(&w);

View File

@ -237,7 +237,7 @@ MainWindow::MainWindow(QWidget *parent)
connect(stop, SIGNAL(activated()), ui_.action_stop, SLOT(trigger()));
connect(next, SIGNAL(activated()), ui_.action_next_track, SLOT(trigger()));
connect(prev, SIGNAL(activated()), ui_.action_previous_track, SLOT(trigger()));
#endif // Q_OS_DARWIN
#endif // Q_OS_LINUX
// Settings
connect(settings_dialog_, SIGNAL(accepted()), player_, SLOT(ReloadSettings()));

View File

@ -183,9 +183,10 @@ win32|fedora-win32-cross:SOURCES += ../3rdparty/qtsingleapplication/qtlockedfile
win32|fedora-win32-cross: {
# Hide the console on windows
CONFIG -= console
CONFIG += windows
LIBS += -Wl,-subsystem,windows
#LIBS += -Wl,-subsystem,windows
# Show console for now since it seems to fix a xine race condition :(
CONFIG += console
}
# Installs

View File

@ -41,7 +41,9 @@ extern "C"
//define this to use xine in a more standard way
//#define XINE_SAFE_MODE
#ifdef Q_OS_WIN32
#define XINE_SAFE_MODE
#endif
///some logging static globals
@ -262,8 +264,8 @@ XineEngine::load( const QUrl &url, bool isStream )
else
{
#ifdef XINE_PARAM_GAPLESS_SWITCH
if ( xine_check_version(1,1,1) && !(m_xfadeLength > 0) )
xine_set_param( m_stream, XINE_PARAM_GAPLESS_SWITCH, 0);
//if ( xine_check_version(1,1,1) && !(m_xfadeLength > 0) )
//xine_set_param( m_stream, XINE_PARAM_GAPLESS_SWITCH, 0);
#endif
}