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

Unified Diff: media/audio/pulse/pulse_output.cc

Issue 12328084: Fix the choppiness for the pulse impl when using a smaller buffer size like 512 samples (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | « media/audio/pulse/pulse.sigs ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/pulse/pulse_output.cc
diff --git a/media/audio/pulse/pulse_output.cc b/media/audio/pulse/pulse_output.cc
index 7cf66cb10c801ba9f7de12c9aae90d1e7e06dc40..ca8fb7f7e2514d51420b3494154abd0a7752d740 100644
--- a/media/audio/pulse/pulse_output.cc
+++ b/media/audio/pulse/pulse_output.cc
@@ -288,6 +288,14 @@ void PulseAudioOutputStream::FulfillWriteRequest(size_t requested_bytes) {
bytes_remaining -= bytes_to_fill;
current_frame = frames_to_fill;
}
+
+ size_t avialable_space = pa_stream_writable_size(pa_stream_);
DaleCurtis 2013/02/25 19:01:29 s/avialable_space/available_space/
no longer working on chromium 2013/02/25 20:03:19 Sorry, I will change it to writable_space
+ if (avialable_space >= static_cast<size_t>(params_.GetBytesPerBuffer())) {
+ if (source_callback_)
+ source_callback_->WaitTillDataReady();
+
+ FulfillWriteRequest(params_.GetBytesPerBuffer());
DaleCurtis 2013/02/25 19:01:29 Hmm, won't this cause faster than normal playback?
no longer working on chromium 2013/02/25 20:03:19 It should not cause fast playback, since we query
+ }
}
void PulseAudioOutputStream::Start(AudioSourceCallback* callback) {
« no previous file with comments | « media/audio/pulse/pulse.sigs ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698