[vlc-commits] commit: macosx/framework: Register VLCMediaPlayer for opening and buffering events (Rune Botten )

git at videolan.org git at videolan.org
Sat Dec 11 16:41:22 CET 2010


vlc | branch: master | Rune Botten <rbotten at gmail.com> | Fri Dec 10 10:49:59 2010 +0100| [383146f35de69f79db68e46d14b3cfafbef06b84] | committer: Pierre d'Herbemont 

macosx/framework: Register VLCMediaPlayer for opening and buffering events

Signed-off-by: Pierre d'Herbemont <pdherbemont at free.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=383146f35de69f79db68e46d14b3cfafbef06b84
---

 projects/macosx/framework/Sources/VLCMediaPlayer.m |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/projects/macosx/framework/Sources/VLCMediaPlayer.m b/projects/macosx/framework/Sources/VLCMediaPlayer.m
index 2912aa3..fce68d6 100644
--- a/projects/macosx/framework/Sources/VLCMediaPlayer.m
+++ b/projects/macosx/framework/Sources/VLCMediaPlayer.m
@@ -108,6 +108,10 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
         newState = VLCMediaPlayerStateStopped;
     else if( event->type == libvlc_MediaPlayerEncounteredError )
         newState = VLCMediaPlayerStateError;
+    else if( event->type == libvlc_MediaPlayerBuffering )
+        newState = VLCMediaPlayerStateBuffering;
+    else if( event->type == libvlc_MediaPlayerOpening )
+        newState = VLCMediaPlayerStateOpening;
     else
     {
         NSLog(@"%s: Unknown event", __FUNCTION__);
@@ -737,10 +741,13 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
     libvlc_event_attach(p_em, libvlc_MediaPlayerPaused,           HandleMediaInstanceStateChanged, self);
     libvlc_event_attach(p_em, libvlc_MediaPlayerEncounteredError, HandleMediaInstanceStateChanged, self);
     libvlc_event_attach(p_em, libvlc_MediaPlayerEndReached,       HandleMediaInstanceStateChanged, self);
+    libvlc_event_attach(p_em, libvlc_MediaPlayerOpening,          HandleMediaInstanceStateChanged, self);
+    libvlc_event_attach(p_em, libvlc_MediaPlayerBuffering,        HandleMediaInstanceStateChanged, self);
+
     /* FIXME: We may want to turn that off when none is interested by that */
-    libvlc_event_attach(p_em, libvlc_MediaPlayerPositionChanged, HandleMediaPositionChanged,      self);
-    libvlc_event_attach(p_em, libvlc_MediaPlayerTimeChanged,     HandleMediaTimeChanged,          self);
-    libvlc_event_attach(p_em, libvlc_MediaPlayerMediaChanged,    HandleMediaPlayerMediaChanged,  self);
+    libvlc_event_attach(p_em, libvlc_MediaPlayerPositionChanged,  HandleMediaPositionChanged,      self);
+    libvlc_event_attach(p_em, libvlc_MediaPlayerTimeChanged,      HandleMediaTimeChanged,          self);
+    libvlc_event_attach(p_em, libvlc_MediaPlayerMediaChanged,     HandleMediaPlayerMediaChanged,   self);
 }
 
 - (void)unregisterObservers
@@ -750,6 +757,9 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
     libvlc_event_detach(p_em, libvlc_MediaPlayerPaused,           HandleMediaInstanceStateChanged, self);
     libvlc_event_detach(p_em, libvlc_MediaPlayerEncounteredError, HandleMediaInstanceStateChanged, self);
     libvlc_event_detach(p_em, libvlc_MediaPlayerEndReached,       HandleMediaInstanceStateChanged, self);
+    libvlc_event_detach(p_em, libvlc_MediaPlayerOpening,          HandleMediaInstanceStateChanged, self);
+    libvlc_event_detach(p_em, libvlc_MediaPlayerBuffering,        HandleMediaInstanceStateChanged, self);
+
     libvlc_event_detach(p_em, libvlc_MediaPlayerPositionChanged,  HandleMediaPositionChanged,      self);
     libvlc_event_detach(p_em, libvlc_MediaPlayerTimeChanged,      HandleMediaTimeChanged,          self);
     libvlc_event_detach(p_em, libvlc_MediaPlayerMediaChanged,     HandleMediaPlayerMediaChanged,   self);



More information about the vlc-commits mailing list