[vlmc-devel] Fix restarting a renderer

Hugo Beauzée-Luyssen git at videolan.org
Mon Feb 24 20:09:43 CET 2014


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Feb 24 19:15:16 2014 +0200| [d99643bcf8b647a543665bd7b26db0fe6ce2044a] | committer: Hugo Beauzée-Luyssen

Fix restarting a renderer

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=d99643bcf8b647a543665bd7b26db0fe6ce2044a
---

 src/Backend/VLC/VLCSourceRenderer.cpp |    6 +++---
 src/Renderer/ClipRenderer.cpp         |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/Backend/VLC/VLCSourceRenderer.cpp b/src/Backend/VLC/VLCSourceRenderer.cpp
index 553c747..55caadc 100644
--- a/src/Backend/VLC/VLCSourceRenderer.cpp
+++ b/src/Backend/VLC/VLCSourceRenderer.cpp
@@ -164,11 +164,11 @@ VLCSourceRenderer::setOption( const QString &option )
 void
 VLCSourceRenderer::start()
 {
-    Q_ASSERT( m_media != NULL );
-    m_mediaPlayer->setMedia( m_media );
+    // If we're re-starting this renderer, we already have assigned a media to it
+    if ( m_media != NULL )
+        m_mediaPlayer->setMedia( m_media );
     m_mediaPlayer->play();
 
-    // Media should not be used after this point, all required information
     // has been acquired by libvlc & any modification on the media from now
     // on would be pointless anyway
     delete m_media;
diff --git a/src/Renderer/ClipRenderer.cpp b/src/Renderer/ClipRenderer.cpp
index bfd05a0..45a601e 100644
--- a/src/Renderer/ClipRenderer.cpp
+++ b/src/Renderer/ClipRenderer.cpp
@@ -138,7 +138,7 @@ ClipRenderer::togglePlayPause( bool forcePause )
     {
         if ( m_isRendering == false )
         {
-            m_sourceRenderer->playPause();
+            m_sourceRenderer->start();
             m_sourceRenderer->setPosition( m_begin / ( m_end - m_begin ) );
             m_isRendering = true;
         }



More information about the Vlmc-devel mailing list