From 46888759da1aea08ef4b5ebdbaee7c10faaecc70 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 13 Dec 2002 23:28:19 +0000 Subject: - activate the threaded xine init code! :) --- (limited to 'noncore') diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index 299239b..8896cfe 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp @@ -94,13 +94,15 @@ Lib::Lib( InitializationMode initMode, XineVideoWidget* widget ) m_initialized = true; } else - assert( false ); + start(); } void Lib::run() { + qDebug( "Lib::run() started" ); initialize(); m_initialized = true; + qDebug( "Lib::run() finished" ); } void Lib::initialize() diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index d6fbb53..0ec6fad 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp @@ -35,6 +35,7 @@ MediaPlayer::MediaPlayer( PlayListWidget &_playList, MediaPlayerState &_mediaPla m_audioUI = 0; m_videoUI = 0; m_xineControl = 0; + xine = new XINE::Lib( XINE::Lib::InitializeInThread ); fd=-1;fl=-1; playList.setCaption( tr( "OpiePlayer: Initializating" ) ); @@ -65,6 +66,11 @@ MediaPlayer::MediaPlayer( PlayListWidget &_playList, MediaPlayerState &_mediaPla } MediaPlayer::~MediaPlayer() { + // this shold never happen, but one never knows... + if ( xine ) { + xine->ensureInitialized(); + delete xine; + } delete m_xineControl; delete m_audioUI; delete m_videoUI; @@ -371,8 +377,12 @@ void MediaPlayer::recreateAudioAndVideoWidgets() const connect( m_videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); connect( m_videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); - XINE::Lib *xine = new XINE::Lib( XINE::Lib::InitializeImmediately ); + if ( !xine ) + xine = new XINE::Lib( XINE::Lib::InitializeImmediately ); + m_xineControl = new XineControl( xine, m_videoUI->vidWidget(), mediaPlayerState ); + + xine = 0; } AudioWidget *MediaPlayer::audioUI() const diff --git a/noncore/multimedia/opieplayer2/mediaplayer.h b/noncore/multimedia/opieplayer2/mediaplayer.h index 351c884..cbe4d86 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.h +++ b/noncore/multimedia/opieplayer2/mediaplayer.h @@ -48,6 +48,11 @@ class MediaPlayerState; class AudioWidget; class VideoWidget; +namespace XINE +{ + class Lib; +}; + class MediaPlayer : public QObject { Q_OBJECT public: @@ -90,6 +95,7 @@ private: mutable XineControl *m_xineControl; mutable AudioWidget *m_audioUI; mutable VideoWidget *m_videoUI; + mutable XINE::Lib *xine; QGuardedPtr m_skinLoader; }; -- cgit v0.9.0.2