summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp16
-rw-r--r--noncore/multimedia/opieplayer2/lib.h13
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.cpp2
3 files changed, 26 insertions, 5 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp
index 1e0dc21..6431de7 100644
--- a/noncore/multimedia/opieplayer2/lib.cpp
+++ b/noncore/multimedia/opieplayer2/lib.cpp
@@ -70,7 +70,7 @@ extern "C" {
using namespace XINE;
-Lib::Lib( XineVideoWidget* widget )
+Lib::Lib( InitializationMode initMode, XineVideoWidget* widget )
{
m_video = false;
m_wid = widget;
@@ -87,8 +87,22 @@ Lib::Lib( XineVideoWidget* widget )
f.close();
}
+ if ( initMode == InitializeImmediately )
+ initialize();
+ else
+ assert( false );
+}
+
+void Lib::run()
+{
+ assert( false );
+}
+
+void Lib::initialize()
+{
m_xine = xine_new( );
+ QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf";
xine_config_load( m_xine, QFile::encodeName( configPath ) );
xine_init( m_xine );
diff --git a/noncore/multimedia/opieplayer2/lib.h b/noncore/multimedia/opieplayer2/lib.h
index aba2ec9..6363918 100644
--- a/noncore/multimedia/opieplayer2/lib.h
+++ b/noncore/multimedia/opieplayer2/lib.h
@@ -55,18 +55,21 @@ namespace XINE {
* stooping, seeking.
*/
class Frame;
- class Lib : public ThreadUtil::Channel
+ class Lib : public ThreadUtil::Channel, private ThreadUtil::Thread
{
Q_OBJECT
public:
- Lib(XineVideoWidget* = 0);
+ enum InitializationMode { InitializeImmediately, InitializeInThread };
+
+ Lib( InitializationMode initMode, XineVideoWidget* = 0);
+
~Lib();
static int majorVersion();
static int minorVersion();
static int subVersion();
- void resize ( const QSize &s );
+ void resize ( const QSize &s );
int play( const QString& fileName,
int startPos = 0,
@@ -183,7 +186,11 @@ namespace XINE {
protected:
virtual void receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType );
+ virtual void run();
+
private:
+ void initialize();
+
int m_bytes_per_pixel;
bool m_video:1;
XineVideoWidget *m_wid;
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp
index efa9934..1aa3daa 100644
--- a/noncore/multimedia/opieplayer2/xinecontrol.cpp
+++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp
@@ -46,7 +46,7 @@ XineControl::XineControl( XineVideoWidget *xineWidget,
: QObject( parent, name ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget )
{
- libXine = new XINE::Lib( xineWidget );
+ libXine = new XINE::Lib( XINE::Lib::InitializeImmediately, xineWidget );
init();
}