[vlmc-devel] VLCMediaPlayer: Log events (except time/position changed)

Hugo Beauzée-Luyssen git at videolan.org
Sat Feb 8 00:47:07 CET 2014


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Sat Feb  8 01:43:59 2014 +0200| [6ca9cf56e3da01004502baf448f4970a6fff37dd] | committer: Hugo Beauzée-Luyssen

VLCMediaPlayer: Log events (except time/position changed)

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

 src/LibVLCpp/VLCMediaPlayer.cpp |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/LibVLCpp/VLCMediaPlayer.cpp b/src/LibVLCpp/VLCMediaPlayer.cpp
index 87c51c6..c0b8520 100644
--- a/src/LibVLCpp/VLCMediaPlayer.cpp
+++ b/src/LibVLCpp/VLCMediaPlayer.cpp
@@ -120,7 +120,11 @@ MediaPlayer::callbacks( const libvlc_event_t* event, void* ptr )
 {
     Q_ASSERT_X( event->type >= libvlc_MediaPlayerMediaChanged &&
                 event->type < libvlc_MediaListItemAdded, "event callback", "Only libvlc_MediaPlayer* events are supported" );
-
+    if (event->type != libvlc_MediaPlayerPositionChanged &&
+            event->type != libvlc_MediaPlayerTimeChanged)
+    {
+        qDebug() << ptr << libvlc_event_type_name(event->type);
+    }
     MediaPlayer* self = reinterpret_cast<MediaPlayer*>( ptr );
 
     self->checkForWaitedEvents( event );
@@ -128,19 +132,15 @@ MediaPlayer::callbacks( const libvlc_event_t* event, void* ptr )
     switch ( event->type )
     {
     case libvlc_MediaPlayerPlaying:
-        //qDebug() << "Media player playing";
         self->emit playing();
         break;
     case libvlc_MediaPlayerPaused:
-        //qDebug() << "Media player paused";
         self->emit paused();
         break;
     case libvlc_MediaPlayerStopped:
-        //qDebug() << "Media player stopped";
         self->emit stopped();
         break;
     case libvlc_MediaPlayerEndReached:
-        //qDebug() << "Media player end reached";
         self->emit endReached();
         break;
     case libvlc_MediaPlayerTimeChanged:
@@ -157,8 +157,6 @@ MediaPlayer::callbacks( const libvlc_event_t* event, void* ptr )
         self->emit snapshotTaken( event->u.media_player_snapshot_taken.psz_filename );
         break;
     case libvlc_MediaPlayerEncounteredError:
-        qDebug() << '[' << (void*)self << "] libvlc_MediaPlayerEncounteredError received."
-                << "This is not looking good...";
         self->emit errorEncountered();
         break;
     case libvlc_MediaPlayerSeekableChanged:



More information about the Vlmc-devel mailing list