Diffstat (limited to 'core/multimedia/opieplayer/loopcontrol.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/loopcontrol.cpp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/core/multimedia/opieplayer/loopcontrol.cpp b/core/multimedia/opieplayer/loopcontrol.cpp index 6dfd057..859a67a 100644 --- a/core/multimedia/opieplayer/loopcontrol.cpp +++ b/core/multimedia/opieplayer/loopcontrol.cpp | |||
@@ -19,3 +19,6 @@ | |||
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | // L.J.Potter added changes Fri 02-15-2002 | ||
21 | |||
20 | #include <qpe/qpeapplication.h> | 22 | #include <qpe/qpeapplication.h> |
23 | |||
21 | #ifdef Q_WS_QWS | 24 | #ifdef Q_WS_QWS |
@@ -234,9 +237,10 @@ void LoopControl::startAudio() { | |||
234 | 237 | ||
235 | if ( ( sampleWaitTime > 2000 ) && ( sampleWaitTime < 20000 ) ) { | 238 | // if ( ( sampleWaitTime > 2000 ) && ( sampleWaitTime < 5000 ) ) { |
236 | usleep( (long)((double)sampleWaitTime * 1000000.0 / freq) ); | 239 | // usleep( (long)((double)sampleWaitTime * 1000000.0 / freq) ); |
237 | } else if ( sampleWaitTime <= -5000 ) { | 240 | // } |
238 | qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); | 241 | // else if ( sampleWaitTime <= -5000 ) { |
239 | //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream ); | 242 | // qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); |
240 | currentSample = sampleWeShouldBeAt; | 243 | // //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream ); |
241 | } | 244 | // currentSample = sampleWeShouldBeAt; |
245 | // } | ||
242 | 246 | ||
@@ -375,3 +379,3 @@ bool LoopControl::init( const QString& filename ) { | |||
375 | channels = mediaPlayerState->curDecoder()->audioChannels( astream ); | 379 | channels = mediaPlayerState->curDecoder()->audioChannels( astream ); |
376 | DecodeLoopDebug(( "channels = %d\n", channels )); | 380 | qDebug( "LC- channels = %d", channels ); |
377 | 381 | ||
@@ -380,3 +384,3 @@ bool LoopControl::init( const QString& filename ) { | |||
380 | 384 | ||
381 | total_audio_samples += 1000; | 385 | // total_audio_samples += 1000; |
382 | 386 | ||
@@ -385,3 +389,3 @@ bool LoopControl::init( const QString& filename ) { | |||
385 | freq = mediaPlayerState->curDecoder()->audioFrequency( astream ); | 389 | freq = mediaPlayerState->curDecoder()->audioFrequency( astream ); |
386 | DecodeLoopDebug(( "frequency = %d\n", freq )); | 390 | qDebug( "LC- frequency = %d", freq ); |
387 | 391 | ||
@@ -389,5 +393,5 @@ bool LoopControl::init( const QString& filename ) { | |||
389 | 393 | ||
390 | static const int bytes_per_sample = 2; //16 bit | 394 | int bits_per_sample = mediaPlayerState->curDecoder()->audioBitsPerSample( astream); |
391 | 395 | ||
392 | audioDevice = new AudioDevice( freq, channels, bytes_per_sample ); | 396 | audioDevice = new AudioDevice( freq, channels, bits_per_sample); |
393 | audioBuffer = new char[ audioDevice->bufferSize() ]; | 397 | audioBuffer = new char[ audioDevice->bufferSize() ]; |