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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 2684103005: Allow media track switching. (Closed)
Patch Set: Added a LayoutTest for media track switching Created 3 years, 9 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: media/blink/webmediaplayer_impl.cc
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index 119810f9214b8611ebb33a8a391d5fc556132f9b..41c1ac8b922cc72949bc2d80ffa46f8ad4f5a7ee 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -1040,19 +1040,23 @@ void WebMediaPlayerImpl::OnFFmpegMediaTracksUpdated(
DCHECK(!chunk_demuxer_);
// Report the media track information to blink.
+ bool first_audio_track = true;
xhwang 2017/03/27 19:13:53 is_first_audio_track ?
servolk 2017/03/27 22:34:12 Done.
+ bool first_video_track = true;
for (const auto& track : tracks->tracks()) {
if (track->type() == MediaTrack::Audio) {
client_->addAudioTrack(blink::WebString::fromUTF8(track->id()),
blink::WebMediaPlayerClient::AudioTrackKindMain,
blink::WebString::fromUTF8(track->label()),
blink::WebString::fromUTF8(track->language()),
- /*enabled*/ true);
+ /*enabled*/ first_audio_track);
xhwang 2017/03/27 19:13:53 This line doesn't make sense now :)
servolk 2017/03/27 22:34:12 If you are talking about the comment, it still doe
xhwang 2017/03/29 00:16:47 I see. Thanks for the context. I think this style
servolk 2017/03/29 01:49:33 Ok, I guess I can completely remove the parameter
+ first_audio_track = false;
} else if (track->type() == MediaTrack::Video) {
client_->addVideoTrack(blink::WebString::fromUTF8(track->id()),
blink::WebMediaPlayerClient::VideoTrackKindMain,
blink::WebString::fromUTF8(track->label()),
blink::WebString::fromUTF8(track->language()),
- /*selected*/ true);
+ /*selected*/ first_video_track);
xhwang 2017/03/27 19:13:53 ditto
servolk 2017/03/27 22:34:12 Acknowledged.
+ first_video_track = false;
} else {
// Text tracks are not supported through this code path yet.
NOTREACHED();

Powered by Google App Engine
This is Rietveld 408576698