[vlc-devel] [PATCH] Fix crash caused by using Volume Slider when no media file is loaded in VLMC
Ankur Gupta
ankur.vision0 at gmail.com
Mon Mar 7 08:12:41 CET 2016
P.S. This patch is my attempt at GSOC 2016. I am a student of Masters in Computer
Science at BITS Pilani, Hyderabad Campus. Kindly revert if I should do more exhaustive patches.
---
src/Renderer/ClipRenderer.cpp | 6 +++++-
src/Renderer/WorkflowRenderer.cpp | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/Renderer/ClipRenderer.cpp b/src/Renderer/ClipRenderer.cpp
index aecdd0a..ec11e09 100644
--- a/src/Renderer/ClipRenderer.cpp
+++ b/src/Renderer/ClipRenderer.cpp
@@ -150,7 +150,11 @@ ClipRenderer::getVolume() const
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_sourceRenderer != NULL)
+ {
+ m_sourceRenderer->setVolume( volume );
+ }
}
void
diff --git a/src/Renderer/WorkflowRenderer.cpp b/src/Renderer/WorkflowRenderer.cpp
index 24a9b55..dd2f88a 100644
--- a/src/Renderer/WorkflowRenderer.cpp
+++ b/src/Renderer/WorkflowRenderer.cpp
@@ -277,7 +277,11 @@ WorkflowRenderer::getVolume() const
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_sourceRenderer != NULL)
+ {
+ m_sourceRenderer->setVolume( volume );
+ }
}
qint64
--
1.9.1
More information about the vlc-devel
mailing list