changeset 10810:a43f158ba8ac

8088722: GSTPlatform cannot play MP4 files with multiple audio tracks Reviewed-by: kcr
author almatvee
date Thu, 18 Jan 2018 17:18:55 -0800
parents 52a55544dd48
children adcac483ae85
files modules/javafx.media/src/main/native/jfxmedia/platform/gstreamer/GstAVPlaybackPipeline.cpp
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/modules/javafx.media/src/main/native/jfxmedia/platform/gstreamer/GstAVPlaybackPipeline.cpp	Thu Jan 18 17:09:59 2018 -0800
+++ b/modules/javafx.media/src/main/native/jfxmedia/platform/gstreamer/GstAVPlaybackPipeline.cpp	Thu Jan 18 17:18:55 2018 -0800
@@ -432,6 +432,18 @@
 
     if (g_str_has_prefix(pstrName, "audio"))
     {
+         // Ignore additional audio tracks if we already have one.
+         // Otherwise files with multiple audio track will fail to play, since
+         // we will not able to connect second audio track.
+         if (pPipeline->m_bHasAudio)
+         {
+            if (pCaps != NULL)
+                gst_caps_unref(pCaps);
+
+            pPipeline->m_pBusCallbackContent->m_DisposeLock->Exit();
+            return;
+        }
+
         if (pPipeline->IsCodecSupported(pCaps))
         {
             pPad = gst_element_get_static_pad(pPipeline->m_Elements[AUDIO_BIN], "sink");