[Mac] Audio tracks in alternate groups are not represented correctly as AudioTracks
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 Mar 2016 00:21:37 +0000 (00:21 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 Mar 2016 00:21:37 +0000 (00:21 +0000)
commite4b7437ee066b2423083f1bb56ab68ec907eb85e
treee1fb5e4a4edc22a2a56a6dd0cd4f1f68de21e1ff
parent7faa1fdbfa53bdb0e1b5e9e61f322b43c70aab6e
[Mac] Audio tracks in alternate groups are not represented correctly as AudioTracks
https://bugs.webkit.org/show_bug.cgi?id=155891
<rdar://problem/24841372>

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/track/video-track-alternate-groups.html

Previously, we created an AudioTrack for every AVPlayerItemTrack, and additionally, a
AudioTrack for every AVMediaSelectionOption that did not have an associated AVAssetTrack.
This caused a number of issues with various types of media, including media with fallback
tracks.

Now, we will create an AudioTrack for every AVMediaSelectionOption, and only create an
AudioTrack for every AVPlayerItem track if no AVMediaSelectionGroups (and thus no
AVMediaSeletionOptions) exist.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::determineChangedTracksFromNewTracksAndOldItems):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):

LayoutTests:

* media/content/audio-tracks-alternate-group-with-fallback.mp4: Added.
* media/content/audio-tracks-no-alternate-group.mp4: Added.
* media/content/audio-tracks-some-in-alternate-group.mp4: Added.
* media/track/video-track-alternate-groups-expected.txt: Added.
* media/track/video-track-alternate-groups.html: Added.
* platform/mac-yosemite/media/track/video-track-alternate-groups-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198703 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/media/content/audio-tracks-alternate-group-with-fallback.mp4 [new file with mode: 0644]
LayoutTests/media/content/audio-tracks-no-alternate-group.mp4 [new file with mode: 0644]
LayoutTests/media/content/audio-tracks-some-in-alternate-group.mp4 [new file with mode: 0644]
LayoutTests/media/track/video-track-alternate-groups-expected.txt [new file with mode: 0644]
LayoutTests/media/track/video-track-alternate-groups.html [new file with mode: 0644]
LayoutTests/platform/mac-yosemite/media/track/video-track-alternate-groups-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm