From 58a456b92ba8986d4ea2375ddcfd6dd1d84c8fe5 Mon Sep 17 00:00:00 2001 From: llornkcor Date: Tue, 19 Mar 2002 12:15:24 +0000 Subject: reverted back till I figure out --- (limited to 'core/multimedia/opieplayer/loopcontrol.cpp') diff --git a/core/multimedia/opieplayer/loopcontrol.cpp b/core/multimedia/opieplayer/loopcontrol.cpp index 4b2827e..b9f96de 100644 --- a/core/multimedia/opieplayer/loopcontrol.cpp +++ b/core/multimedia/opieplayer/loopcontrol.cpp @@ -19,7 +19,6 @@ **********************************************************************/ // L.J.Potter added changes Fri 02-15-2002 - #include #ifdef Q_WS_QWS @@ -221,6 +220,7 @@ void LoopControl::startVideo() { void LoopControl::startAudio() { +//qDebug("start audio"); audioMutex->lock(); if ( moreAudio ) { @@ -236,14 +236,14 @@ void LoopControl::startAudio() { long sampleWeShouldBeAt = long( playtime.elapsed() ) * freq / 1000; long sampleWaitTime = currentSample - sampleWeShouldBeAt; -// if ( ( sampleWaitTime > 2000 ) && ( sampleWaitTime < 20000 ) ) { -// usleep( (long)((double)sampleWaitTime * 1000000.0 / freq) ); -// } -// else if ( sampleWaitTime <= -5000 ) { -// // qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); -// //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream ); -// currentSample = sampleWeShouldBeAt; -// } +// if ( ( sampleWaitTime > 2000 ) && ( sampleWaitTime < 20000 ) ) { +// usleep( (long)((double)sampleWaitTime * 1000000.0 / freq) ); +// } +// else if ( sampleWaitTime <= -5000 ) { +// qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); +// //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream ); +// currentSample = sampleWeShouldBeAt; +// } audioDevice->write( audioBuffer, samplesRead * 2 * channels ); audioSampleCounter = currentSample + samplesRead - 1; @@ -378,7 +378,7 @@ bool LoopControl::init( const QString& filename ) { int astream = 0; channels = mediaPlayerState->curDecoder()->audioChannels( astream ); -// qDebug( "LC- channels = %d", channels ); + qDebug( "LC- channels = %d", channels ); if ( !total_audio_samples ) total_audio_samples = mediaPlayerState->curDecoder()->audioSamples( astream ); @@ -388,17 +388,15 @@ bool LoopControl::init( const QString& filename ) { mediaPlayerState->setLength( total_audio_samples ); freq = mediaPlayerState->curDecoder()->audioFrequency( astream ); -// qDebug( "LC- frequency = %d", freq ); + qDebug( "LC- frequency = %d", freq ); audioSampleCounter = 0; int bits_per_sample; - if ( mediaPlayerState->curDecoder()->pluginName() == QString("WavPlugin") ) { + if ( mediaPlayerState->curDecoder()->pluginName() == QString("LibWavPlugin") ) { bits_per_sample =(int) mediaPlayerState->curDecoder()->getTime(); -// qDebug("using stupid hack"); + qDebug("using stupid hack"); } else { - bits_per_sample=0; -// freq=44100; - channels=2; + bits_per_sample=0; } audioDevice = new AudioDevice( freq, channels, bits_per_sample); -- cgit v0.9.0.2