Bug 557432 - Don't Shutdown() nsAudioStream in Drain() when there's no audio playing. r=kinetik

This commit is contained in:
Chris Pearce 2010-04-12 10:26:34 +12:00
parent 20d7ad6361
commit 2c49cfe6ca

View File

@ -227,9 +227,10 @@ void nsAudioStream::Drain()
return;
}
if (sa_stream_drain(static_cast<sa_stream_t*>(mAudioHandle)) != SA_SUCCESS) {
PR_LOG(gAudioStreamLog, PR_LOG_ERROR, ("nsAudioStream: sa_stream_drain error"));
Shutdown();
int r = sa_stream_drain(static_cast<sa_stream_t*>(mAudioHandle));
if (r != SA_SUCCESS && r != SA_ERROR_INVALID) {
PR_LOG(gAudioStreamLog, PR_LOG_ERROR, ("nsAudioStream: sa_stream_drain error"));
Shutdown();
}
}