summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/loopcontrol.cpp
authorllornkcor <llornkcor>2003-02-25 23:38:02 (UTC)
committer llornkcor <llornkcor>2003-02-25 23:38:02 (UTC)
commit94cb45ce60cc00d719a802baeb8acf74f42150d2 (patch) (unidiff)
tree27f70d60579a5301f04986e56cf4bfa2067dad9c /core/multimedia/opieplayer/loopcontrol.cpp
parentbde9ed97c92b6f7eefa8a66d9f58aa4c78127733 (diff)
downloadopie-94cb45ce60cc00d719a802baeb8acf74f42150d2.zip
opie-94cb45ce60cc00d719a802baeb8acf74f42150d2.tar.gz
opie-94cb45ce60cc00d719a802baeb8acf74f42150d2.tar.bz2
remove libmad depending on libmpeg3, and fix crash when skin not found
Diffstat (limited to 'core/multimedia/opieplayer/loopcontrol.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/loopcontrol.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/core/multimedia/opieplayer/loopcontrol.cpp b/core/multimedia/opieplayer/loopcontrol.cpp
index ba14882..8cf0a75 100644
--- a/core/multimedia/opieplayer/loopcontrol.cpp
+++ b/core/multimedia/opieplayer/loopcontrol.cpp
@@ -100,7 +100,7 @@ LoopControl::LoopControl( QObject *parent, const char *name )
100 : QObject( parent, name ) { 100 : QObject( parent, name ) {
101 isMuted = FALSE; 101 isMuted = FALSE;
102 connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( setMute(bool) ) ); 102 connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( setMute(bool) ) );
103//qDebug("starting loopcontrol"); 103qDebug("starting loopcontrol");
104 audioMutex = new Mutex; 104 audioMutex = new Mutex;
105 105
106 pthread_attr_init(&audio_attr); 106 pthread_attr_init(&audio_attr);
@@ -117,7 +117,7 @@ LoopControl::LoopControl( QObject *parent, const char *name )
117 pthread_attr_init(&audio_attr); 117 pthread_attr_init(&audio_attr);
118 } 118 }
119#endif 119#endif
120//qDebug("create audio thread"); 120qDebug("create audio thread");
121 pthread_create(&audio_tid, &audio_attr, (void * (*)(void *))startAudioThread, this); 121 pthread_create(&audio_tid, &audio_attr, (void * (*)(void *))startAudioThread, this);
122} 122}
123 123
@@ -364,12 +364,12 @@ bool LoopControl::init( const QString& filename ) {
364 qDebug( "Using the %s decoder", mediaPlayerState->curDecoder()->pluginName() ); 364 qDebug( "Using the %s decoder", mediaPlayerState->curDecoder()->pluginName() );
365 365
366 // ### Hack to use libmpeg3plugin to get the number of audio samples if we are using the libmad plugin 366 // ### Hack to use libmpeg3plugin to get the number of audio samples if we are using the libmad plugin
367 if ( mediaPlayerState->curDecoder()->pluginName() == QString("LibMadPlugin") ) { 367// if ( mediaPlayerState->curDecoder()->pluginName() == QString("LibMadPlugin") ) {
368 if ( mediaPlayerState->libMpeg3Decoder() && mediaPlayerState->libMpeg3Decoder()->open( filename )) { 368// if ( mediaPlayerState->libMpeg3Decoder() && mediaPlayerState->libMpeg3Decoder()->open( filename )) {
369 total_audio_samples = mediaPlayerState->libMpeg3Decoder()->audioSamples( 0 ); 369// total_audio_samples = mediaPlayerState->libMpeg3Decoder()->audioSamples( 0 );
370 mediaPlayerState->libMpeg3Decoder()->close(); 370// mediaPlayerState->libMpeg3Decoder()->close();
371 } 371// }
372 } 372// }
373 373
374 if ( !mediaPlayerState->curDecoder()|| !mediaPlayerState->curDecoder()->open( filename ) ) { 374 if ( !mediaPlayerState->curDecoder()|| !mediaPlayerState->curDecoder()->open( filename ) ) {
375 audioMutex->unlock(); 375 audioMutex->unlock();
@@ -389,11 +389,11 @@ bool LoopControl::init( const QString& filename ) {
389 389
390 qDebug( "LC- channels = %d", channels ); 390 qDebug( "LC- channels = %d", channels );
391 391
392 if ( !total_audio_samples ) 392// if ( !total_audio_samples )
393 total_audio_samples = mediaPlayerState->curDecoder()->audioSamples( astream ); 393 total_audio_samples = mediaPlayerState->curDecoder()->audioSamples( astream );
394 394
395 total_audio_samples += 1000; 395 total_audio_samples += 1000;
396 396 qDebug("total samples %d", total_audio_samples);
397 mediaPlayerState->setLength( total_audio_samples ); 397 mediaPlayerState->setLength( total_audio_samples );
398 398
399 freq = mediaPlayerState->curDecoder()->audioFrequency( astream ); 399 freq = mediaPlayerState->curDecoder()->audioFrequency( astream );