summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/loopcontrol.cpp
authorllornkcor <llornkcor>2002-03-18 01:50:17 (UTC)
committer llornkcor <llornkcor>2002-03-18 01:50:17 (UTC)
commitc09cb25eb6bbf31bed0d4a415802469cfd1efedf (patch) (unidiff)
tree86ced0fa482bd5fb244629f2baa1b1a4f25c9189 /core/multimedia/opieplayer/loopcontrol.cpp
parent848182342d81b4e6ab4ce6b75bdaa0b109828af3 (diff)
downloadopie-c09cb25eb6bbf31bed0d4a415802469cfd1efedf.zip
opie-c09cb25eb6bbf31bed0d4a415802469cfd1efedf.tar.gz
opie-c09cb25eb6bbf31bed0d4a415802469cfd1efedf.tar.bz2
added stuff and fixed stuff that I dont remember- plays w/o going to playlist among other things
Diffstat (limited to 'core/multimedia/opieplayer/loopcontrol.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/multimedia/opieplayer/loopcontrol.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/core/multimedia/opieplayer/loopcontrol.cpp b/core/multimedia/opieplayer/loopcontrol.cpp
index cb8de8a..4b2827e 100644
--- a/core/multimedia/opieplayer/loopcontrol.cpp
+++ b/core/multimedia/opieplayer/loopcontrol.cpp
@@ -221,7 +221,6 @@ void LoopControl::startVideo() {
221 221
222void LoopControl::startAudio() { 222void LoopControl::startAudio() {
223 223
224//qDebug("start audio");
225 audioMutex->lock(); 224 audioMutex->lock();
226 if ( moreAudio ) { 225 if ( moreAudio ) {
227 226
@@ -241,7 +240,7 @@ void LoopControl::startAudio() {
241// usleep( (long)((double)sampleWaitTime * 1000000.0 / freq) ); 240// usleep( (long)((double)sampleWaitTime * 1000000.0 / freq) );
242// } 241// }
243// else if ( sampleWaitTime <= -5000 ) { 242// else if ( sampleWaitTime <= -5000 ) {
244// qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); 243// // qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt );
245// //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream ); 244// //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream );
246// currentSample = sampleWeShouldBeAt; 245// currentSample = sampleWeShouldBeAt;
247// } 246// }
@@ -379,7 +378,7 @@ bool LoopControl::init( const QString& filename ) {
379 int astream = 0; 378 int astream = 0;
380 379
381 channels = mediaPlayerState->curDecoder()->audioChannels( astream ); 380 channels = mediaPlayerState->curDecoder()->audioChannels( astream );
382 qDebug( "LC- channels = %d", channels ); 381// qDebug( "LC- channels = %d", channels );
383 382
384 if ( !total_audio_samples ) 383 if ( !total_audio_samples )
385 total_audio_samples = mediaPlayerState->curDecoder()->audioSamples( astream ); 384 total_audio_samples = mediaPlayerState->curDecoder()->audioSamples( astream );
@@ -389,15 +388,17 @@ bool LoopControl::init( const QString& filename ) {
389 mediaPlayerState->setLength( total_audio_samples ); 388 mediaPlayerState->setLength( total_audio_samples );
390 389
391 freq = mediaPlayerState->curDecoder()->audioFrequency( astream ); 390 freq = mediaPlayerState->curDecoder()->audioFrequency( astream );
392 qDebug( "LC- frequency = %d", freq ); 391// qDebug( "LC- frequency = %d", freq );
393 392
394 audioSampleCounter = 0; 393 audioSampleCounter = 0;
395 int bits_per_sample; 394 int bits_per_sample;
396 if ( mediaPlayerState->curDecoder()->pluginName() == QString("LibWavPlugin") ) { 395 if ( mediaPlayerState->curDecoder()->pluginName() == QString("WavPlugin") ) {
397 bits_per_sample =(int) mediaPlayerState->curDecoder()->getTime(); 396 bits_per_sample =(int) mediaPlayerState->curDecoder()->getTime();
398 qDebug("using stupid hack"); 397// qDebug("using stupid hack");
399 } else { 398 } else {
400 bits_per_sample=0; 399 bits_per_sample=0;
400// freq=44100;
401 channels=2;
401 } 402 }
402 403
403 audioDevice = new AudioDevice( freq, channels, bits_per_sample); 404 audioDevice = new AudioDevice( freq, channels, bits_per_sample);