[vlmc-devel] [PATCH] Fix crash caused by using Volume Slider when no media (redited)

FearNotMyCreed . ankur.vision0 at gmail.com
Mon Mar 7 14:32:46 CET 2016


>From 57a2e520ab3963e04a5d41e56f209d29c20337d5 Mon Sep 17 00:00:00 2001
From: Ankur Gupta <ankur.vision0 at gmail.com>
Date: Mon, 7 Mar 2016 18:57:19 +0530
Subject: [PATCH] Fix crash caused by using Volume Slider when no media

---
 src/Renderer/ClipRenderer.cpp     | 9 +++++++--
 src/Renderer/WorkflowRenderer.cpp | 9 +++++++--
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/Renderer/ClipRenderer.cpp b/src/Renderer/ClipRenderer.cpp
index aecdd0a..d33da9c 100644
--- a/src/Renderer/ClipRenderer.cpp
+++ b/src/Renderer/ClipRenderer.cpp
@@ -147,10 +147,15 @@ ClipRenderer::getVolume() const
     return m_sourceRenderer->volume();
 }

-void ClipRenderer::setVolume( int volume )
+void
+ClipRenderer::setVolume( int volume )
 {
     //Returns 0 if the volume was set, -1 if it was out of range
-    return m_sourceRenderer->setVolume( volume );
+    //Handles the 'Clip Preview Window' VolSlider Crash when media  file
is not loaded
+    if(m_isRendering == true)
+    {
+        m_sourceRenderer->setVolume( volume );
+    }
 }

 void
diff --git a/src/Renderer/WorkflowRenderer.cpp
b/src/Renderer/WorkflowRenderer.cpp
index 24a9b55..ccb8a43 100644
--- a/src/Renderer/WorkflowRenderer.cpp
+++ b/src/Renderer/WorkflowRenderer.cpp
@@ -274,10 +274,15 @@ WorkflowRenderer::getVolume() const
     return m_sourceRenderer->volume();
 }

-void WorkflowRenderer::setVolume( int volume )
+void
+WorkflowRenderer::setVolume( int volume )
 {
     //Returns 0 if the volume was set, -1 if it was out of range
-    m_sourceRenderer->setVolume( volume );
+    //Handles the 'Project Preview Window' VolSlider Crash when media file
is not loaded
+    if( m_isRendering == true )
+    {
+    m_sourceRenderer->setVolume( volume );
+    }
 }

 qint64
-- 
1.9.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlmc-devel/attachments/20160307/c5805a7d/attachment.html>


More information about the Vlmc-devel mailing list