From 0559e149a7a07463a5eeab8bc6a5792bba14326b Mon Sep 17 00:00:00 2001 From: llornkcor Date: Thu, 18 Jul 2002 04:36:33 +0000 Subject: change for video --- (limited to 'core/multimedia/opieplayer') diff --git a/core/multimedia/opieplayer/loopcontrol.cpp b/core/multimedia/opieplayer/loopcontrol.cpp index 70e4a78..ba14882 100644 --- a/core/multimedia/opieplayer/loopcontrol.cpp +++ b/core/multimedia/opieplayer/loopcontrol.cpp @@ -236,14 +236,16 @@ void LoopControl::startAudio() { long sampleWaitTime = currentSample - sampleWeShouldBeAt; // this causes drop outs not sure why its even here -// 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 ( hasVideoChannel ) { + 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 ); -- cgit v0.9.0.2