From 70812fdcfbd98d6a29c22f7f6979105e0ee5517c Mon Sep 17 00:00:00 2001 From: Pierre d'Herbemont Date: Wed, 27 Jan 2010 23:01:21 +0100 Subject: [PATCH] macosx/framework: Export -gotoNextFrame. --- .../framework/Headers/Public/VLCMediaPlayer.h | 5 +++++ .../macosx/framework/Sources/VLCMediaPlayer.m | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/projects/macosx/framework/Headers/Public/VLCMediaPlayer.h b/projects/macosx/framework/Headers/Public/VLCMediaPlayer.h index 36c039b783..95f589edb8 100644 --- a/projects/macosx/framework/Headers/Public/VLCMediaPlayer.h +++ b/projects/macosx/framework/Headers/Public/VLCMediaPlayer.h @@ -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. */ diff --git a/projects/macosx/framework/Sources/VLCMediaPlayer.m b/projects/macosx/framework/Sources/VLCMediaPlayer.m index 303a7136dc..d8e4243c48 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]; -- 2.39.5