author | simon <simon> | 2002-12-13 23:28:19 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-13 23:28:19 (UTC) |
commit | 46888759da1aea08ef4b5ebdbaee7c10faaecc70 (patch) (side-by-side diff) | |
tree | 50120eb119daf39cda2c3168f710eff5a8855117 | |
parent | 1830ae3069a3ca35df678ce6d1700bf31d968a5c (diff) | |
download | opie-46888759da1aea08ef4b5ebdbaee7c10faaecc70.zip opie-46888759da1aea08ef4b5ebdbaee7c10faaecc70.tar.gz opie-46888759da1aea08ef4b5ebdbaee7c10faaecc70.tar.bz2 |
- activate the threaded xine init code! :)
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 4 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 12 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.h | 6 |
3 files changed, 20 insertions, 2 deletions
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 @@ -95,11 +95,13 @@ Lib::Lib( InitializationMode initMode, XineVideoWidget* widget ) } else - assert( false ); + start(); } void Lib::run() { + qDebug( "Lib::run() started" ); initialize(); m_initialized = true; + qDebug( "Lib::run() finished" ); } 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 @@ -36,4 +36,5 @@ MediaPlayer::MediaPlayer( PlayListWidget &_playList, MediaPlayerState &_mediaPla m_videoUI = 0; m_xineControl = 0; + xine = new XINE::Lib( XINE::Lib::InitializeInThread ); fd=-1;fl=-1; @@ -66,4 +67,9 @@ 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; @@ -372,6 +378,10 @@ void MediaPlayer::recreateAudioAndVideoWidgets() const 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; } 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 @@ -49,4 +49,9 @@ class AudioWidget; class VideoWidget; +namespace XINE +{ + class Lib; +}; + class MediaPlayer : public QObject { Q_OBJECT @@ -91,4 +96,5 @@ private: mutable AudioWidget *m_audioUI; mutable VideoWidget *m_videoUI; + mutable XINE::Lib *xine; QGuardedPtr<SkinLoader> m_skinLoader; |