author | bipolar <bipolar> | 2002-02-01 18:41:28 (UTC) |
---|---|---|
committer | bipolar <bipolar> | 2002-02-01 18:41:28 (UTC) |
commit | 190a0111ccd874923bf88dac938531a18f52e698 (patch) (side-by-side diff) | |
tree | 422dcb8c17724eb061624f442f0fa6a3116d789b | |
parent | 9a8990097aa35d28a9c758f730c5c8b5fa59560a (diff) | |
download | opie-190a0111ccd874923bf88dac938531a18f52e698.zip opie-190a0111ccd874923bf88dac938531a18f52e698.tar.gz opie-190a0111ccd874923bf88dac938531a18f52e698.tar.bz2 |
Mediaplayer hang fix
-rw-r--r-- | core/multimedia/opieplayer/libmad/libmadplugin.cpp | 8 | ||||
-rw-r--r-- | core/multimedia/opieplayer/loopcontrol.cpp | 4 | ||||
-rw-r--r-- | core/multimedia/opieplayer/wavplugin/wavplugin.cpp | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/core/multimedia/opieplayer/libmad/libmadplugin.cpp b/core/multimedia/opieplayer/libmad/libmadplugin.cpp index b2b876f..9d04f7e 100644 --- a/core/multimedia/opieplayer/libmad/libmadplugin.cpp +++ b/core/multimedia/opieplayer/libmad/libmadplugin.cpp @@ -494,5 +494,5 @@ bool LibMadPlugin::audioReadSamples( short *output, int /*channels*/, long sampl if ( samples == 0 ) - return TRUE; + return FALSE; do { @@ -502,5 +502,5 @@ bool LibMadPlugin::audioReadSamples( short *output, int /*channels*/, long sampl // needInput = FALSE; // else - return TRUE; + return FALSE; } @@ -508,5 +508,5 @@ bool LibMadPlugin::audioReadSamples( short *output, int /*channels*/, long sampl if ( decode( output, samples, samplesMade ) ) - return FALSE; + return TRUE; else needInput = TRUE; @@ -522,5 +522,5 @@ bool LibMadPlugin::audioReadSamples( short *output, int /*channels*/, long sampl } else */ - return TRUE; + return FALSE; } diff --git a/core/multimedia/opieplayer/loopcontrol.cpp b/core/multimedia/opieplayer/loopcontrol.cpp index 93a6e3f..6dfd057 100644 --- a/core/multimedia/opieplayer/loopcontrol.cpp +++ b/core/multimedia/opieplayer/loopcontrol.cpp @@ -229,5 +229,5 @@ void LoopControl::startAudio() { long samplesRead = 0; - mediaPlayerState->curDecoder()->audioReadSamples( (short*)audioBuffer, channels, 1024, samplesRead, stream ); + bool readOk=mediaPlayerState->curDecoder()->audioReadSamples( (short*)audioBuffer, channels, 1024, samplesRead, stream ); long sampleWeShouldBeAt = long( playtime.elapsed() ) * freq / 1000; long sampleWaitTime = currentSample - sampleWeShouldBeAt; @@ -244,5 +244,5 @@ void LoopControl::startAudio() { audioSampleCounter = currentSample + samplesRead - 1; - moreAudio = audioSampleCounter <= total_audio_samples; + moreAudio = readOk && (audioSampleCounter <= total_audio_samples); } else { diff --git a/core/multimedia/opieplayer/wavplugin/wavplugin.cpp b/core/multimedia/opieplayer/wavplugin/wavplugin.cpp index 60a0024..a6bd974 100644 --- a/core/multimedia/opieplayer/wavplugin/wavplugin.cpp +++ b/core/multimedia/opieplayer/wavplugin/wavplugin.cpp @@ -324,5 +324,5 @@ bool WavPlugin::audioReadStereoSamples( short *output, long samples, long& sampl bool WavPlugin::audioReadSamples( short *output, int channels, long samples, long& samplesMade, int ) { debugMsg( "WavPlugin::audioReadSamples" ); - return !d->add( output, samples, samplesMade, channels != 1 ); + return d->add( output, samples, samplesMade, channels != 1 ); } |