[vlmc-devel] VLCMediaPlayer: Account for libvlc_audio_output_set return code

Hugo Beauzée-Luyssen git at videolan.org
Fri Mar 7 19:14:35 CET 2014


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Fri Mar  7 18:09:17 2014 +0100| [d94146173da9f70e28df8a29b82b520685bd0adc] | committer: Hugo Beauzée-Luyssen

VLCMediaPlayer: Account for libvlc_audio_output_set return code

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

 src/Backend/VLC/LibVLCpp/VLCMediaPlayer.cpp |    4 ++--
 src/Backend/VLC/LibVLCpp/VLCMediaPlayer.h   |    2 +-
 src/Backend/VLC/VLCVmemRenderer.cpp         |    3 ++-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/Backend/VLC/LibVLCpp/VLCMediaPlayer.cpp b/src/Backend/VLC/LibVLCpp/VLCMediaPlayer.cpp
index 0d1eea6..d8d4193 100644
--- a/src/Backend/VLC/LibVLCpp/VLCMediaPlayer.cpp
+++ b/src/Backend/VLC/LibVLCpp/VLCMediaPlayer.cpp
@@ -223,10 +223,10 @@ MediaPlayer::setKeyInput( bool enabled )
     libvlc_video_set_key_input( m_internalPtr, enabled );
 }
 
-void
+bool
 MediaPlayer::setAudioOutput(const char *module)
 {
-    libvlc_audio_output_set( m_internalPtr, module );
+    return libvlc_audio_output_set( m_internalPtr, module ) == 0;
 }
 
 void
diff --git a/src/Backend/VLC/LibVLCpp/VLCMediaPlayer.h b/src/Backend/VLC/LibVLCpp/VLCMediaPlayer.h
index b4de7f9..7f4d06e 100644
--- a/src/Backend/VLC/LibVLCpp/VLCMediaPlayer.h
+++ b/src/Backend/VLC/LibVLCpp/VLCMediaPlayer.h
@@ -69,7 +69,7 @@ namespace   LibVLCpp
         int                                 getNbAudioTrack();
         int                                 getNbVideoTrack();
         void                                setKeyInput( bool enabled );
-        void                                setAudioOutput(const char* module);
+        bool                                setAudioOutput(const char* module);
         void                                disableTitle();
         void                                setupVmemCallbacks( libvlc_video_lock_cb lock, libvlc_video_unlock_cb unlock,
                                                         libvlc_video_display_cb display, void* data );
diff --git a/src/Backend/VLC/VLCVmemRenderer.cpp b/src/Backend/VLC/VLCVmemRenderer.cpp
index 4adcb77..53c6afc 100644
--- a/src/Backend/VLC/VLCVmemRenderer.cpp
+++ b/src/Backend/VLC/VLCVmemRenderer.cpp
@@ -36,7 +36,8 @@ VmemRenderer::VmemRenderer( VLCBackend* backend, VLCSource *source , ISourceRend
     m_snapshot = new QImage( 320, 180, QImage::Format_RGB32 );
     m_mediaPlayer->setupVmem( "RV32", m_snapshot->width(), m_snapshot->height(), m_snapshot->bytesPerLine() );
     m_mediaPlayer->setupVmemCallbacks( &VmemRenderer::vmemLock, &VmemRenderer::vmemUnlock, NULL, this );
-    m_mediaPlayer->setAudioOutput( "dummy" );
+    if ( m_mediaPlayer->setAudioOutput( "dummy" ) == false )
+        vlmcWarning() << "Failed to disable audio output";
 }
 
 VmemRenderer::~VmemRenderer()



More information about the Vlmc-devel mailing list