summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp
index f1b9773..6ed4cea 100644
--- a/noncore/multimedia/opieplayer2/lib.cpp
+++ b/noncore/multimedia/opieplayer2/lib.cpp
@@ -128,12 +128,13 @@ void Lib::initialize()
128 // allocate oss for sound 128 // allocate oss for sound
129 // and fb for framebuffer 129 // and fb for framebuffer
130 m_audioOutput = xine_open_audio_driver( m_xine, "oss", NULL ); 130 m_audioOutput = xine_open_audio_driver( m_xine, "oss", NULL );
131 m_videoOutput = ::init_video_out_plugin( m_xine, NULL, xine_display_frame, this ); 131 m_videoOutput = ::init_video_out_plugin( m_xine, NULL, xine_display_frame, this );
132 132
133 m_stream = xine_stream_new (m_xine, m_audioOutput, m_videoOutput ); 133 m_stream = xine_stream_new (m_xine, m_audioOutput, m_videoOutput );
134 xine_set_param( m_stream, XINE_PARAM_AUDIO_CLOSE_DEVICE, 1);
134 135
135 if (m_wid != 0 ) 136 if (m_wid != 0 )
136 setWidget( m_wid ); 137 setWidget( m_wid );
137 138
138 139
139 m_queue = xine_event_new_queue (m_stream); 140 m_queue = xine_event_new_queue (m_stream);
@@ -199,18 +200,26 @@ int Lib::play( const QString& fileName, int startPos, int start_time ) {
199 return xine_play( m_stream, startPos, start_time); 200 return xine_play( m_stream, startPos, start_time);
200} 201}
201 202
202void Lib::stop() { 203void Lib::stop() {
203 assert( m_initialized ); 204 assert( m_initialized );
204 xine_stop( m_stream ); 205 xine_stop( m_stream );
206 xine_set_param( m_stream, XINE_PARAM_AUDIO_CLOSE_DEVICE, 1);
205} 207}
206 208
207void Lib::pause( bool toggle ) { 209void Lib::pause( bool toggle ) {
208 assert( m_initialized ); 210 assert( m_initialized );
209 211
210 xine_set_param( m_stream, XINE_PARAM_SPEED, toggle ? XINE_SPEED_PAUSE : XINE_SPEED_NORMAL ); 212 if ( toggle ) {
213 xine_set_param( m_stream, XINE_PARAM_SPEED, XINE_SPEED_PAUSE );
214 xine_set_param( m_stream, XINE_PARAM_AUDIO_CLOSE_DEVICE, 1);
215 }
216
217 else {
218 xine_set_param( m_stream, XINE_PARAM_SPEED, XINE_SPEED_NORMAL );
219 }
211} 220}
212 221
213int Lib::speed() const { 222int Lib::speed() const {
214 assert( m_initialized ); 223 assert( m_initialized );
215 224
216 return xine_get_param ( m_stream, XINE_PARAM_SPEED ); 225 return xine_get_param ( m_stream, XINE_PARAM_SPEED );
@@ -279,13 +288,23 @@ bool Lib::isSeekable() const {
279 return xine_get_stream_info( m_stream, XINE_STREAM_INFO_SEEKABLE ); 288 return xine_get_stream_info( m_stream, XINE_STREAM_INFO_SEEKABLE );
280} 289}
281 290
282void Lib::seekTo( int time ) { 291void Lib::seekTo( int time ) {
283 assert( m_initialized ); 292 assert( m_initialized );
284 293
285 xine_play( m_stream, 0, time*1000 ); 294 odebug << "Seeking to second " << time << oendl;
295 //Keep it paused if it was in that state
296 if ( xine_get_param( m_stream, XINE_PARAM_SPEED ) ) {
297 xine_play( m_stream, 0, time*1000 );
298 }
299
300 else {
301 xine_play( m_stream, 0, time*1000 );
302 xine_set_param( m_stream, XINE_PARAM_SPEED, XINE_SPEED_PAUSE );
303 }
304
286} 305}
287 306
288 307
289Frame Lib::currentFrame() const { 308Frame Lib::currentFrame() const {
290 assert( m_initialized ); 309 assert( m_initialized );
291 310