[vlmc-devel] ClipRenderer: Fix a crash when removing the clip being previewd.
Hugo Beauzée-Luyssen
git at videolan.org
Sun Sep 23 20:46:42 CEST 2012
vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Sun Sep 23 20:45:44 2012 +0300| [8456bc8de7e3fa116902477bc69c2e932045659f] | committer: Hugo Beauzée-Luyssen
ClipRenderer: Fix a crash when removing the clip being previewd.
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=8456bc8de7e3fa116902477bc69c2e932045659f
---
src/Renderer/ClipRenderer.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/Renderer/ClipRenderer.cpp b/src/Renderer/ClipRenderer.cpp
index fe8224f..f5b0826 100644
--- a/src/Renderer/ClipRenderer.cpp
+++ b/src/Renderer/ClipRenderer.cpp
@@ -60,9 +60,12 @@ ClipRenderer::~ClipRenderer()
void
ClipRenderer::setClip( Clip* clip )
{
- if ( m_selectedClip != NULL && clip != NULL &&
- clip->uuid() != m_selectedClip->uuid() )
+ // if the clip is different (or NULL) we have to stop playback.
+ if ( m_selectedClip != NULL &&
+ ( ( clip != NULL && clip->uuid() != m_selectedClip->uuid() ) || clip == NULL ) )
+ {
clipUnloaded( m_selectedClip->uuid() );
+ }
if ( clip == NULL )
{
m_selectedClip = NULL;
More information about the Vlmc-devel
mailing list