author | simon <simon> | 2002-12-13 23:07:43 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-13 23:07:43 (UTC) |
commit | 2e922ec81282a735a04ca1e822329c615b979ebf (patch) (side-by-side diff) | |
tree | 742b662eb9d441aec1a12f2d3b531245b934cdb1 | |
parent | 2e91febca20a3b550d06ba33a4d41b40555a8bbf (diff) | |
download | opie-2e922ec81282a735a04ca1e822329c615b979ebf.zip opie-2e922ec81282a735a04ca1e822329c615b979ebf.tar.gz opie-2e922ec81282a735a04ca1e822329c615b979ebf.tar.bz2 |
- fill in some code on the threading side. not activated, yet
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 13 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.h | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 3 |
3 files changed, 16 insertions, 2 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index cef46a1..84194b7 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp @@ -98,9 +98,10 @@ Lib::Lib( InitializationMode initMode, XineVideoWidget* widget ) } void Lib::run() { - assert( false ); + initialize(); + m_initialized = true; } void Lib::initialize() { @@ -282,8 +283,18 @@ int Lib::error() const { return xine_get_error( m_stream ); }; +void Lib::ensureInitialized() +{ + if ( m_initialized ) + return; + + qDebug( "waiting for initialization thread to finish" ); + wait(); + qDebug( "initialization thread finished!" ); +} + void Lib::receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType ) { assert( sendType == ThreadUtil::Channel::OneWay ); handleXineEvent( msg->type() ); diff --git a/noncore/multimedia/opieplayer2/lib.h b/noncore/multimedia/opieplayer2/lib.h index 9dd7385..6b67f67 100644 --- a/noncore/multimedia/opieplayer2/lib.h +++ b/noncore/multimedia/opieplayer2/lib.h @@ -176,8 +176,10 @@ namespace XINE { * XINE_ERROR_DEMUXER_FAILED 3 */ int error() const; + void ensureInitialized(); + signals: void stopped(); diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index 1aa3daa..7c54499 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp @@ -44,9 +44,8 @@ XineControl::XineControl( XineVideoWidget *xineWidget, MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name ) : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget ) { - libXine = new XINE::Lib( XINE::Lib::InitializeImmediately, xineWidget ); init(); } @@ -55,8 +54,10 @@ XineControl::XineControl( XINE::Lib *xine, XineVideoWidget *xineWidget, MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name ) : QObject( parent, name ), libXine( xine ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget ) { + xine->ensureInitialized(); + init(); } void XineControl::init() |