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
@@ -71,5 +71,5 @@ extern "C" {
using namespace XINE;
-Lib::Lib( XineVideoWidget* widget )
+Lib::Lib( InitializationMode initMode, XineVideoWidget* widget )
{
m_video = false;
@@ -88,6 +88,20 @@ Lib::Lib( XineVideoWidget* widget )
}
+ 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 ) );
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
@@ -56,9 +56,12 @@ namespace XINE {
*/
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();
@@ -67,5 +70,5 @@ namespace XINE {
- void resize ( const QSize &s );
+ void resize ( const QSize &s );
int play( const QString& fileName,
@@ -184,5 +187,9 @@ namespace XINE {
virtual void receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType );
+ virtual void run();
+
private:
+ void initialize();
+
int m_bytes_per_pixel;
bool m_video:1;
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
@@ -47,5 +47,5 @@ XineControl::XineControl( XineVideoWidget *xineWidget,
{
- libXine = new XINE::Lib( xineWidget );
+ libXine = new XINE::Lib( XINE::Lib::InitializeImmediately, xineWidget );
init();