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(); |