Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(608)

Unified Diff: media/audio/android/opensles_output.cc

Issue 11744026: Add guard to OpenSLESOutputStream::FillBufferQueue() to respect shutdown conditions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/android/opensles_output.cc
diff --git a/media/audio/android/opensles_output.cc b/media/audio/android/opensles_output.cc
index 26ae25b6a0b355726542a20ff33bea90a963b0b1..f8313006d50035cf4560ce24e10a9881c1e093c4 100644
--- a/media/audio/android/opensles_output.cc
+++ b/media/audio/android/opensles_output.cc
@@ -260,6 +260,8 @@ void OpenSLESOutputStream::FillBufferQueue() {
uint32 hardware_delay = buffer_size_bytes_;
int frames_filled = callback_->OnMoreData(
audio_bus_.get(), AudioBuffersState(0, hardware_delay));
+ if (frames_filled <= 0)
+ return; // Audio source is shutting down, or halted on error.
int num_filled_bytes =
frames_filled * audio_bus_->channels() * format_.bitsPerSample / 8;
DCHECK_LE(static_cast<size_t>(num_filled_bytes), buffer_size_bytes_);
@@ -303,7 +305,7 @@ void OpenSLESOutputStream::ReleaseAudioBuffer() {
}
void OpenSLESOutputStream::HandleError(SLresult error) {
- DLOG(FATAL) << "OpenSLES error " << error;
+ DLOG(ERROR) << "OpenSLES error " << error;
if (callback_)
callback_->OnError(this, error);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698