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

Unified Diff: content/renderer/pepper/pepper_media_stream_audio_track_host.cc

Issue 857093002: Set audio format before adding pepper sink to audio track. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests. Created 5 years, 11 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
Index: content/renderer/pepper/pepper_media_stream_audio_track_host.cc
diff --git a/content/renderer/pepper/pepper_media_stream_audio_track_host.cc b/content/renderer/pepper/pepper_media_stream_audio_track_host.cc
index c2dacf535cac5df0f916c027e1e66db3458edd59..c8f9e7d51509be2690f9c76caf8558cb2e8a1bd5 100644
--- a/content/renderer/pepper/pepper_media_stream_audio_track_host.cc
+++ b/content/renderer/pepper/pepper_media_stream_audio_track_host.cc
@@ -364,6 +364,13 @@ void PepperMediaStreamAudioTrackHost::OnNewBufferEnqueued() {
void PepperMediaStreamAudioTrackHost::DidConnectPendingHostToResource() {
if (!connected_) {
+ media::AudioParameters format =
+ MediaStreamAudioSink::GetFormatFromAudioTrack(track_);
+ // Although this should only be called on the audio capture thread, that
+ // can't happen until the sink is added to the audio track below.
dmichael (off chromium) 2015/01/20 17:07:03 This seems kind of dangerous. Is there any way for
DaleCurtis 2015/01/20 18:46:56 Yeah the API contract should document this. I'm no
Anand Mistry (off Chromium) 2015/01/27 02:12:10 Nope. The audio capture thread is a real-time thre
+ if (format.IsValid())
+ audio_sink_.OnSetFormat(format);
+
MediaStreamAudioSink::AddToAudioTrack(&audio_sink_, track_);
connected_ = true;
}

Powered by Google App Engine
This is Rietveld 408576698