summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-13 23:28:19 (UTC)
committer simon <simon>2002-12-13 23:28:19 (UTC)
commit46888759da1aea08ef4b5ebdbaee7c10faaecc70 (patch) (unidiff)
tree50120eb119daf39cda2c3168f710eff5a8855117
parent1830ae3069a3ca35df678ce6d1700bf31d968a5c (diff)
downloadopie-46888759da1aea08ef4b5ebdbaee7c10faaecc70.zip
opie-46888759da1aea08ef4b5ebdbaee7c10faaecc70.tar.gz
opie-46888759da1aea08ef4b5ebdbaee7c10faaecc70.tar.bz2
- activate the threaded xine init code! :)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp4
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp12
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.h6
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
@@ -94,13 +94,15 @@ Lib::Lib( InitializationMode initMode, XineVideoWidget* widget )
94 m_initialized = true; 94 m_initialized = true;
95 } 95 }
96 else 96 else
97 assert( false ); 97 start();
98} 98}
99 99
100void Lib::run() 100void Lib::run()
101{ 101{
102 qDebug( "Lib::run() started" );
102 initialize(); 103 initialize();
103 m_initialized = true; 104 m_initialized = true;
105 qDebug( "Lib::run() finished" );
104} 106}
105 107
106void Lib::initialize() 108void 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
35 m_audioUI = 0; 35 m_audioUI = 0;
36 m_videoUI = 0; 36 m_videoUI = 0;
37 m_xineControl = 0; 37 m_xineControl = 0;
38 xine = new XINE::Lib( XINE::Lib::InitializeInThread );
38 39
39 fd=-1;fl=-1; 40 fd=-1;fl=-1;
40 playList.setCaption( tr( "OpiePlayer: Initializating" ) ); 41 playList.setCaption( tr( "OpiePlayer: Initializating" ) );
@@ -65,6 +66,11 @@ MediaPlayer::MediaPlayer( PlayListWidget &_playList, MediaPlayerState &_mediaPla
65} 66}
66 67
67MediaPlayer::~MediaPlayer() { 68MediaPlayer::~MediaPlayer() {
69 // this shold never happen, but one never knows...
70 if ( xine ) {
71 xine->ensureInitialized();
72 delete xine;
73 }
68 delete m_xineControl; 74 delete m_xineControl;
69 delete m_audioUI; 75 delete m_audioUI;
70 delete m_videoUI; 76 delete m_videoUI;
@@ -371,8 +377,12 @@ void MediaPlayer::recreateAudioAndVideoWidgets() const
371 connect( m_videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); 377 connect( m_videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
372 connect( m_videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); 378 connect( m_videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
373 379
374 XINE::Lib *xine = new XINE::Lib( XINE::Lib::InitializeImmediately ); 380 if ( !xine )
381 xine = new XINE::Lib( XINE::Lib::InitializeImmediately );
382
375 m_xineControl = new XineControl( xine, m_videoUI->vidWidget(), mediaPlayerState ); 383 m_xineControl = new XineControl( xine, m_videoUI->vidWidget(), mediaPlayerState );
384
385 xine = 0;
376} 386}
377 387
378AudioWidget *MediaPlayer::audioUI() const 388AudioWidget *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;
48class AudioWidget; 48class AudioWidget;
49class VideoWidget; 49class VideoWidget;
50 50
51namespace XINE
52{
53 class Lib;
54};
55
51class MediaPlayer : public QObject { 56class MediaPlayer : public QObject {
52 Q_OBJECT 57 Q_OBJECT
53public: 58public:
@@ -90,6 +95,7 @@ private:
90 mutable XineControl *m_xineControl; 95 mutable XineControl *m_xineControl;
91 mutable AudioWidget *m_audioUI; 96 mutable AudioWidget *m_audioUI;
92 mutable VideoWidget *m_videoUI; 97 mutable VideoWidget *m_videoUI;
98 mutable XINE::Lib *xine;
93 99
94 QGuardedPtr<SkinLoader> m_skinLoader; 100 QGuardedPtr<SkinLoader> m_skinLoader;
95}; 101};