summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp13
-rw-r--r--noncore/multimedia/opieplayer2/lib.h2
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.cpp3
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
@@ -96,13 +96,14 @@ Lib::Lib( InitializationMode initMode, XineVideoWidget* widget )
96 else 96 else
97 assert( false ); 97 assert( false );
98} 98}
99 99
100void Lib::run() 100void Lib::run()
101{ 101{
102 assert( false ); 102 initialize();
103 m_initialized = true;
103} 104}
104 105
105void Lib::initialize() 106void Lib::initialize()
106{ 107{
107 m_duringInitialization = true; 108 m_duringInitialization = true;
108 m_xine = xine_new( ); 109 m_xine = xine_new( );
@@ -280,12 +281,22 @@ QString Lib::metaInfo( int number) const {
280int Lib::error() const { 281int Lib::error() const {
281 assert( m_initialized ); 282 assert( m_initialized );
282 283
283 return xine_get_error( m_stream ); 284 return xine_get_error( m_stream );
284}; 285};
285 286
287void Lib::ensureInitialized()
288{
289 if ( m_initialized )
290 return;
291
292 qDebug( "waiting for initialization thread to finish" );
293 wait();
294 qDebug( "initialization thread finished!" );
295}
296
286void Lib::receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType ) 297void Lib::receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType )
287{ 298{
288 assert( sendType == ThreadUtil::Channel::OneWay ); 299 assert( sendType == ThreadUtil::Channel::OneWay );
289 handleXineEvent( msg->type() ); 300 handleXineEvent( msg->type() );
290 delete msg; 301 delete msg;
291} 302}
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
@@ -174,12 +174,14 @@ namespace XINE {
174 * XINE_ERROR_NO_INPUT_PLUGIN 1 174 * XINE_ERROR_NO_INPUT_PLUGIN 1
175 * XINE_ERROR_NO_DEMUXER_PLUGIN 2 175 * XINE_ERROR_NO_DEMUXER_PLUGIN 2
176 * XINE_ERROR_DEMUXER_FAILED 3 176 * XINE_ERROR_DEMUXER_FAILED 3
177 */ 177 */
178 int error() const; 178 int error() const;
179 179
180 void ensureInitialized();
181
180 signals: 182 signals:
181 183
182 void stopped(); 184 void stopped();
183 185
184 void initialized(); 186 void initialized();
185 187
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
@@ -42,23 +42,24 @@
42 42
43XineControl::XineControl( XineVideoWidget *xineWidget, 43XineControl::XineControl( XineVideoWidget *xineWidget,
44 MediaPlayerState &_mediaPlayerState, 44 MediaPlayerState &_mediaPlayerState,
45 QObject *parent, const char *name ) 45 QObject *parent, const char *name )
46 : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget ) 46 : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget )
47{ 47{
48
49 libXine = new XINE::Lib( XINE::Lib::InitializeImmediately, xineWidget ); 48 libXine = new XINE::Lib( XINE::Lib::InitializeImmediately, xineWidget );
50 49
51 init(); 50 init();
52} 51}
53 52
54XineControl::XineControl( XINE::Lib *xine, XineVideoWidget *xineWidget, 53XineControl::XineControl( XINE::Lib *xine, XineVideoWidget *xineWidget,
55 MediaPlayerState &_mediaPlayerState, 54 MediaPlayerState &_mediaPlayerState,
56 QObject *parent, const char *name ) 55 QObject *parent, const char *name )
57 : QObject( parent, name ), libXine( xine ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget ) 56 : QObject( parent, name ), libXine( xine ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget )
58{ 57{
58 xine->ensureInitialized();
59
59 init(); 60 init();
60} 61}
61 62
62void XineControl::init() 63void XineControl::init()
63{ 64{
64 connect( &mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pause( bool ) ) ); 65 connect( &mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pause( bool ) ) );