summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp17
-rw-r--r--noncore/multimedia/opieplayer2/lib.h2
2 files changed, 14 insertions, 5 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp
index 9e818eb..641cbca 100644
--- a/noncore/multimedia/opieplayer2/lib.cpp
+++ b/noncore/multimedia/opieplayer2/lib.cpp
@@ -35,12 +35,13 @@
35#include <stdlib.h> 35#include <stdlib.h>
36#include <qimage.h> 36#include <qimage.h>
37#include <qtextstream.h> 37#include <qtextstream.h>
38#include <qpe/resource.h> 38#include <qpe/resource.h>
39 39
40#include <qfile.h> 40#include <qfile.h>
41#include <qdir.h>
41 42
42#include <qgfx_qws.h> 43#include <qgfx_qws.h>
43#include <qdirectpainter_qws.h> 44#include <qdirectpainter_qws.h>
44 45
45#include <assert.h> 46#include <assert.h>
46 47
@@ -70,28 +71,33 @@ extern "C" {
70using namespace XINE; 71using namespace XINE;
71 72
72Lib::Lib( XineVideoWidget* widget ) { 73Lib::Lib( XineVideoWidget* widget ) {
73 m_video = false; 74 m_video = false;
74 m_wid = widget; 75 m_wid = widget;
75 printf("Lib"); 76 printf("Lib");
76 QCString str( getenv("HOME") ); 77 QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf";
77 str += "/Settings/opiexine.cf";
78 // get the configuration 78 // get the configuration
79 79
80 // not really OO, should be an extra class, later 80 // not really OO, should be an extra class, later
81 if ( !QFile(str).exists() ) { 81 if ( !QFile::exists(configPath) ) {
82 QFile f(str); 82 QFile f(configPath);
83 f.open(IO_WriteOnly); 83 f.open(IO_WriteOnly);
84 QTextStream ts( &f ); 84 QTextStream ts( &f );
85 ts << "misc.memcpy_method:glibc\n"; 85 ts << "misc.memcpy_method:glibc\n";
86 f.close(); 86 f.close();
87 } 87 }
88 88
89 initialize();
90}
91
92void Lib::initialize()
93{
89 m_xine = xine_new( ); 94 m_xine = xine_new( );
90 95
91 xine_config_load( m_xine, str.data() ); 96 QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf";
97 xine_config_load( m_xine, QFile::encodeName( configPath ) );
92 98
93 xine_init( m_xine ); 99 xine_init( m_xine );
94 100
95 // allocate oss for sound 101 // allocate oss for sound
96 // and fb for framebuffer 102 // and fb for framebuffer
97 m_audioOutput = xine_open_audio_driver( m_xine, "oss", NULL ); 103 m_audioOutput = xine_open_audio_driver( m_xine, "oss", NULL );
@@ -113,12 +119,13 @@ Lib::Lib( XineVideoWidget* widget ) {
113 m_wid->repaint(); 119 m_wid->repaint();
114 } 120 }
115 121
116 m_queue = xine_event_new_queue (m_stream); 122 m_queue = xine_event_new_queue (m_stream);
117 123
118 xine_event_create_listener_thread (m_queue, xine_event_handler, this); 124 xine_event_create_listener_thread (m_queue, xine_event_handler, this);
125
119} 126}
120 127
121Lib::~Lib() { 128Lib::~Lib() {
122// free( m_config ); 129// free( m_config );
123 130
124 xine_close( m_stream ); 131 xine_close( m_stream );
diff --git a/noncore/multimedia/opieplayer2/lib.h b/noncore/multimedia/opieplayer2/lib.h
index 37a4f9a..d546c99 100644
--- a/noncore/multimedia/opieplayer2/lib.h
+++ b/noncore/multimedia/opieplayer2/lib.h
@@ -178,12 +178,14 @@ namespace XINE {
178 void stopped(); 178 void stopped();
179 179
180 protected: 180 protected:
181 virtual void receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType ); 181 virtual void receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType );
182 182
183 private: 183 private:
184 void initialize();
185
184 int m_bytes_per_pixel; 186 int m_bytes_per_pixel;
185 bool m_video:1; 187 bool m_video:1;
186 XineVideoWidget *m_wid; 188 XineVideoWidget *m_wid;
187 xine_t *m_xine; 189 xine_t *m_xine;
188 xine_stream_t *m_stream; 190 xine_stream_t *m_stream;
189 xine_cfg_entry_t *m_config; 191 xine_cfg_entry_t *m_config;