]> git.sesse.net Git - vlc/commitdiff
macosx/framework: Export -gotoNextFrame.
authorPierre d'Herbemont <pdherbemont@free.fr>
Wed, 27 Jan 2010 22:01:21 +0000 (23:01 +0100)
committerPierre d'Herbemont <pdherbemont@free.fr>
Thu, 28 Jan 2010 15:59:37 +0000 (16:59 +0100)
projects/macosx/framework/Headers/Public/VLCMediaPlayer.h
projects/macosx/framework/Sources/VLCMediaPlayer.m

index 36c039b78310d2d1f1e79fd31ed4be9c4b9c19a8..95f589edb8ff6db4fdf348294fe7c88361a37318 100644 (file)
@@ -242,6 +242,11 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
  */
 - (void)stop;
 
+/**
+ * Advance one frame.
+ */
+- (void)gotoNextFrame;
+
 /**
  * Fast forwards through the feed at the standard 1x rate.
  */
index 303a7136dcf98fdb2ea5f30f854170a081770c53..d8e4243c4855fb0462c3cc1ee4ff4ffb105a14b7 100644 (file)
@@ -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];