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

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

Issue 129793012: Implement hook to change audio output device for PulseAudio. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix build error. Created 6 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_util.h ('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_util.cc
diff --git a/media/audio/pulse/pulse_util.cc b/media/audio/pulse/pulse_util.cc
index 96831cfabe3277fd165ec45b92995dad29978d72..bee47902dea2ea682e3086574f5c66324e8baf6f 100644
--- a/media/audio/pulse/pulse_util.cc
+++ b/media/audio/pulse/pulse_util.cc
@@ -205,6 +205,7 @@ bool CreateOutputStream(pa_threaded_mainloop** mainloop,
pa_context** context,
pa_stream** stream,
const AudioParameters& params,
+ const std::string& device_id,
pa_stream_notify_cb_t stream_callback,
pa_stream_request_cb_t write_callback,
void* user_data) {
@@ -287,12 +288,16 @@ bool CreateOutputStream(pa_threaded_mainloop** mainloop,
// and error.
RETURN_ON_FAILURE(
pa_stream_connect_playback(
- *stream, NULL, &pa_buffer_attributes,
+ *stream,
+ device_id == AudioManagerBase::kDefaultDeviceId ?
+ NULL : device_id.c_str(),
+ &pa_buffer_attributes,
static_cast<pa_stream_flags_t>(
PA_STREAM_INTERPOLATE_TIMING | PA_STREAM_ADJUST_LATENCY |
PA_STREAM_AUTO_TIMING_UPDATE | PA_STREAM_NOT_MONOTONIC |
PA_STREAM_START_CORKED),
- NULL, NULL) == 0,
+ NULL,
+ NULL) == 0,
"pa_stream_connect_playback FAILED ");
// Wait for the stream to be ready.
« no previous file with comments | « media/audio/pulse/pulse_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698