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

Unified Diff: content/renderer/media/media_stream_renderer_factory_impl.cc

Issue 1512273002: Handle the case when a mediastream track doesn't have extra data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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: content/renderer/media/media_stream_renderer_factory_impl.cc
diff --git a/content/renderer/media/media_stream_renderer_factory_impl.cc b/content/renderer/media/media_stream_renderer_factory_impl.cc
index 929519efdb5fdf922effe50a5d61fda0299a5c13..3163953062809700771066625430c89c483ddc6d 100644
--- a/content/renderer/media/media_stream_renderer_factory_impl.cc
+++ b/content/renderer/media/media_stream_renderer_factory_impl.cc
@@ -141,7 +141,15 @@ MediaStreamRendererFactoryImpl::GetAudioRenderer(
// and mixes audio from all the tracks that belong to the media stream.
// For now, we have separate renderers depending on if the first audio track
// in the stream is local or remote.
- if (MediaStreamTrack::GetTrack(audio_tracks[0])->is_local_track()) {
+ MediaStreamTrack* audio_track = MediaStreamTrack::GetTrack(audio_tracks[0]);
+ if (!audio_track) {
+ // This can happen if the track was cloned.
+ // TODO(tommi, perkj): Fix cloning of tracks to handle extra data too.
perkj_chrome 2015/12/10 12:44:44 Is this an audio track problem in general or only
tommi (sloooow) - chröme 2015/12/10 13:37:37 In general and I don't think this is an issue with
+ LOG(ERROR) << "No native track for WebMediaStreamTrack.";
+ return nullptr;
+ }
+
+ if (audio_track->is_local_track()) {
// TODO(xians): Add support for the case where the media stream contains
// multiple audio tracks.
return CreateLocalAudioRenderer(audio_tracks[0], render_frame_id, device_id,
« 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