Commit 3cdc77bf authored by bfulgham@apple.com's avatar bfulgham@apple.com

[Windows] some track language tags are not recognized

https://bugs.webkit.org/show_bug.cgi?id=120335

Reviewed by Eric Carlson.

* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: Revise implementation
to match logic in platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjc.mm


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154693 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 39206f75
2013-08-26 Brent Fulgham <bfulgham@apple.com>
[Windows] some track language tags are not recognized
https://bugs.webkit.org/show_bug.cgi?id=120335
Reviewed by Eric Carlson.
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: Revise implementation
to match logic in platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjc.mm
2013-08-27 Andreas Kling <akling@apple.com>
Clumsily fix Gtk+ build. Not my proudest moment.
......@@ -849,6 +849,8 @@ void MediaPlayerPrivateAVFoundationCF::tracksChanged()
if (!avAsset(m_avfWrapper))
return;
setDelayCharacteristicsChangedNotification(true);
bool haveCCTrack = false;
bool hasCaptions = false;
......@@ -922,8 +924,10 @@ void MediaPlayerPrivateAVFoundationCF::tracksChanged()
sizeChanged();
if (!primaryAudioTrackLanguage.isNull() && primaryAudioTrackLanguage != languageOfPrimaryAudioTrack())
if (primaryAudioTrackLanguage != languageOfPrimaryAudioTrack())
player()->characteristicChanged();
setDelayCharacteristicsChangedNotification(false);
}
void MediaPlayerPrivateAVFoundationCF::sizeChanged()
......@@ -1105,6 +1109,12 @@ String MediaPlayerPrivateAVFoundationCF::languageOfPrimaryAudioTrack() const
AVCFAssetTrackRef track = (AVCFAssetTrackRef)CFArrayGetValueAtIndex(tracks.get(), 0);
RetainPtr<CFStringRef> language = adoptCF(AVCFAssetTrackCopyExtendedLanguageTag(track));
// If the language code is stored as a QuickTime 5-bit packed code there aren't enough bits for a full
// RFC 4646 language tag so extendedLanguageTag returns null. In this case languageCode will return the
// ISO 639-2/T language code so check it.
if (!language)
language = adoptCF(AVCFAssetTrackCopyLanguageCode(track));
// Some legacy tracks have "und" as a language, treat that the same as no language at all.
if (language && CFStringCompare(language.get(), CFSTR("und"), kCFCompareCaseInsensitive) != kCFCompareEqualTo) {
m_languageOfPrimaryAudioTrack = language.get();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment