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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 2684103005: Allow media track switching. (Closed)
Patch Set: Updated GpuMemoryBufferVideoFramePool comment 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 97c5b7f87324732622838bd82182c5c15acdcffe..e83bdb81b5f8a7eef154d5ad36efe9f59e02e3d2 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -1021,20 +1021,25 @@ void WebMediaPlayerImpl::OnFFmpegMediaTracksUpdated(
DCHECK(demuxer_.get());
DCHECK(!chunk_demuxer_);
- // Report the media track information to blink.
+ // Report the media track information to blink. Only the first audio track and
+ // the first video track are enabled by default to match blink logic.
+ bool is_first_audio_track = true;
+ bool is_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);
+ is_first_audio_track);
+ is_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);
+ is_first_video_track);
+ is_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