author | llornkcor <llornkcor> | 2002-02-25 00:26:33 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-02-25 00:26:33 (UTC) |
commit | c0446b55fc32b7fdea9f58db06e40da703f5e8ff (patch) (unidiff) | |
tree | b84cbcdf9d2687bb3e8672981a6e62577c98becb /core/multimedia/opieplayer/loopcontrol.cpp | |
parent | 146ed85c70bf6a288294e91baceb9af9ec5b8611 (diff) | |
download | opie-c0446b55fc32b7fdea9f58db06e40da703f5e8ff.zip opie-c0446b55fc32b7fdea9f58db06e40da703f5e8ff.tar.gz opie-c0446b55fc32b7fdea9f58db06e40da703f5e8ff.tar.bz2 |
*** empty log message ***
Diffstat (limited to 'core/multimedia/opieplayer/loopcontrol.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/loopcontrol.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/core/multimedia/opieplayer/loopcontrol.cpp b/core/multimedia/opieplayer/loopcontrol.cpp index 859a67a..1ae0059 100644 --- a/core/multimedia/opieplayer/loopcontrol.cpp +++ b/core/multimedia/opieplayer/loopcontrol.cpp | |||
@@ -232,20 +232,20 @@ void LoopControl::startAudio() { | |||
232 | 232 | ||
233 | long samplesRead = 0; | 233 | long samplesRead = 0; |
234 | bool readOk=mediaPlayerState->curDecoder()->audioReadSamples( (short*)audioBuffer, channels, 1024, samplesRead, stream ); | 234 | bool readOk=mediaPlayerState->curDecoder()->audioReadSamples( (short*)audioBuffer, channels, 1024, samplesRead, stream ); |
235 | long sampleWeShouldBeAt = long( playtime.elapsed() ) * freq / 1000; | 235 | long sampleWeShouldBeAt = long( playtime.elapsed() ) * freq / 1000; |
236 | long sampleWaitTime = currentSample - sampleWeShouldBeAt; | 236 | long sampleWaitTime = currentSample - sampleWeShouldBeAt; |
237 | 237 | ||
238 | // if ( ( sampleWaitTime > 2000 ) && ( sampleWaitTime < 5000 ) ) { | 238 | if ( ( sampleWaitTime > 2000 ) && ( sampleWaitTime < 20000 ) ) { |
239 | // usleep( (long)((double)sampleWaitTime * 1000000.0 / freq) ); | 239 | usleep( (long)((double)sampleWaitTime * 1000000.0 / freq) ); |
240 | // } | 240 | } |
241 | // else if ( sampleWaitTime <= -5000 ) { | 241 | else if ( sampleWaitTime <= -5000 ) { |
242 | // qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); | 242 | qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); |
243 | // //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream ); | 243 | //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream ); |
244 | // currentSample = sampleWeShouldBeAt; | 244 | currentSample = sampleWeShouldBeAt; |
245 | // } | 245 | } |
246 | 246 | ||
247 | audioDevice->write( audioBuffer, samplesRead * 2 * channels ); | 247 | audioDevice->write( audioBuffer, samplesRead * 2 * channels ); |
248 | audioSampleCounter = currentSample + samplesRead - 1; | 248 | audioSampleCounter = currentSample + samplesRead - 1; |
249 | 249 | ||
250 | moreAudio = readOk && (audioSampleCounter <= total_audio_samples); | 250 | moreAudio = readOk && (audioSampleCounter <= total_audio_samples); |
251 | 251 | ||