author | llornkcor <llornkcor> | 2002-06-17 12:54:54 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-06-17 12:54:54 (UTC) |
commit | 282007e58a8a038a0db042341528510e73ac80fc (patch) (side-by-side diff) | |
tree | f1a16c9a6a380bdc4217e9f92ac6ef6128d10717 /core/multimedia/opieplayer/loopcontrol.cpp | |
parent | 2917d7481dc8c1b053e3212a699e64948a90ec4c (diff) | |
download | opie-282007e58a8a038a0db042341528510e73ac80fc.zip opie-282007e58a8a038a0db042341528510e73ac80fc.tar.gz opie-282007e58a8a038a0db042341528510e73ac80fc.tar.bz2 |
fixes for goofy crap going on
Diffstat (limited to 'core/multimedia/opieplayer/loopcontrol.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/loopcontrol.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/core/multimedia/opieplayer/loopcontrol.cpp b/core/multimedia/opieplayer/loopcontrol.cpp index 3171c4b..70e4a78 100644 --- a/core/multimedia/opieplayer/loopcontrol.cpp +++ b/core/multimedia/opieplayer/loopcontrol.cpp @@ -154,5 +154,5 @@ void LoopControl::timerEvent( QTimerEvent *te ) { void LoopControl::setPosition( long pos ) { audioMutex->lock(); - +// qDebug("Loop control %d", pos); if ( hasVideoChannel && hasAudioChannel ) { playtime.restart(); @@ -221,5 +221,4 @@ void LoopControl::startVideo() { void LoopControl::startAudio() { -//qDebug("start audio"); audioMutex->lock(); if ( moreAudio ) { @@ -238,12 +237,12 @@ void LoopControl::startAudio() { // 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 ( ( 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 ); @@ -346,6 +345,8 @@ void LoopControl::stop( bool willPlayAgainShortly ) { audioMutex->unlock(); - } + audioSampleCounter=0; + current_frame=0; + total_audio_samples=0; } @@ -353,5 +354,4 @@ void LoopControl::stop( bool willPlayAgainShortly ) { bool LoopControl::init( const QString& filename ) { stop(); - audioMutex->lock(); @@ -451,4 +451,6 @@ bool LoopControl::init( const QString& filename ) { void LoopControl::play() { qDebug("LC- play"); + mediaPlayerState->setPosition( 0); //uglyhack + #if defined(Q_WS_QWS) && !defined(QT_NO_COP) if ( !disabledSuspendScreenSaver || previousSuspendMode != hasVideoChannel ) { |