[vlc-devel] commit: macosx/framework: Export -gotoNextFrame. (Pierre d'Herbemont )

git version control git at videolan.org
Thu Jan 28 16:59:44 CET 2010


vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Wed Jan 27 23:01:21 2010 +0100| [70812fdcfbd98d6a29c22f7f6979105e0ee5517c] | committer: Pierre d'Herbemont 

macosx/framework: Export -gotoNextFrame.

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

 .../framework/Headers/Public/VLCMediaPlayer.h      |    5 +++++
 projects/macosx/framework/Sources/VLCMediaPlayer.m |   15 ++++++++++++++-
 2 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/projects/macosx/framework/Headers/Public/VLCMediaPlayer.h b/projects/macosx/framework/Headers/Public/VLCMediaPlayer.h
index 36c039b..95f589e 100644
--- a/projects/macosx/framework/Headers/Public/VLCMediaPlayer.h
+++ b/projects/macosx/framework/Headers/Public/VLCMediaPlayer.h
@@ -243,6 +243,11 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
 - (void)stop;
 
 /**
+ * Advance one frame.
+ */
+- (void)gotoNextFrame;
+
+/**
  * Fast forwards through the feed at the standard 1x rate.
  */
 - (void)fastForward;
diff --git a/projects/macosx/framework/Sources/VLCMediaPlayer.m b/projects/macosx/framework/Sources/VLCMediaPlayer.m
index 303a713..d8e4243 100644
--- a/projects/macosx/framework/Sources/VLCMediaPlayer.m
+++ b/projects/macosx/framework/Sources/VLCMediaPlayer.m
@@ -396,7 +396,11 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s
     libvlc_exception_t ex;
     libvlc_exception_init( &ex );
     float result = libvlc_media_player_get_rate( instance, &ex );
-    catch_exception( &ex );
+    if (libvlc_exception_raised(&ex))
+    {
+        result = 1;
+        libvlc_exception_clear(&ex);
+    }
     return result;
 }
 
@@ -692,6 +696,15 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s
     libvlc_media_player_stop(instance);
 }
 
+- (void)gotoNextFrame
+{
+    libvlc_exception_t e;
+    libvlc_exception_init(&e);
+    libvlc_media_player_next_frame(instance, &e);
+    catch_exception(&e);
+
+}
+
 - (void)fastForward
 {
     [self fastForwardAtRate: 2.0];




More information about the vlc-devel mailing list