[GStreamer] Redundant track language notifications
authorphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Feb 2015 16:43:41 +0000 (16:43 +0000)
committerphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Feb 2015 16:43:41 +0000 (16:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=141908

Reviewed by Žan Doberšek.

Invoke languageChanged only if the language code actually
changed.

* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180503 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp

index 050da3d..7264e25 100644 (file)
@@ -1,3 +1,16 @@
+2015-02-23  Philippe Normand  <pnormand@igalia.com>
+
+        [GStreamer] Redundant track language notifications
+        https://bugs.webkit.org/show_bug.cgi?id=141908
+
+        Reviewed by Žan Doberšek.
+
+        Invoke languageChanged only if the language code actually
+        changed.
+
+        * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
+        (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged):
+
 2015-02-23  peavo@outlook.com  <peavo@outlook.com>
 
         [WinCairo] Crash when media player is destroyed.
index 36461be..5c9043c 100644 (file)
@@ -167,8 +167,15 @@ void TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged()
     if (getTag(tags.get(), GST_TAG_TITLE, m_label))
         client->labelChanged(m_owner, m_label);
 
-    if (getLanguageCode(tags.get(), m_language))
-        client->languageChanged(m_owner, m_language);
+    AtomicString language;
+    if (!getLanguageCode(tags.get(), language))
+        return;
+
+    if (language == m_language)
+        return;
+
+    m_language = language;
+    client->languageChanged(m_owner, m_language);
 }
 
 } // namespace WebCore