changeset 10809:52a55544dd48

8193313: MediaPlayer Leaking Native Memory Reviewed-by: kcr
author almatvee
date Thu, 18 Jan 2018 17:09:59 -0800
parents eb72cc1ca5ed
children a43f158ba8ac
files modules/javafx.media/src/main/native/jfxmedia/platform/gstreamer/GstAVPlaybackPipeline.cpp
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/modules/javafx.media/src/main/native/jfxmedia/platform/gstreamer/GstAVPlaybackPipeline.cpp	Wed Jan 17 15:16:51 2018 -0800
+++ b/modules/javafx.media/src/main/native/jfxmedia/platform/gstreamer/GstAVPlaybackPipeline.cpp	Thu Jan 18 17:09:59 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -599,6 +599,10 @@
     }
     else if ((state == GST_STATE_PLAYING && pending_state == GST_STATE_VOID_PENDING) || (state == GST_STATE_PAUSED && pending_state == GST_STATE_PLAYING) || (state == GST_STATE_PAUSED && pending_state == GST_STATE_PAUSED))
     {
+        // Do not increment queue if we playing and only have one track
+        if (!(m_bHasAudio && m_bHasVideo))
+            return;
+
         if (m_Elements[AUDIO_QUEUE] == element)
         {
             g_object_get(m_Elements[VIDEO_QUEUE], "current-level-buffers", &current_level_buffers, NULL);