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

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: Compile fix. 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
« no previous file with comments | « content/renderer/pepper/pepper_media_stream_audio_track_host.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
+ if (format.IsValid())
+ audio_sink_.OnSetFormat(format);
+
MediaStreamAudioSink::AddToAudioTrack(&audio_sink_, track_);
connected_ = true;
}
« no previous file with comments | « content/renderer/pepper/pepper_media_stream_audio_track_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698