[vlc-devel] commit: osx/framework: don' t interfere with the NSCell API and fail gracefully if pausing throws an exception ( Felix Paul Kühne )

git version control git at videolan.org
Mon Dec 21 01:23:47 CET 2009


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sun Dec 20 17:16:19 2009 +0100| [42a162155564489fe694b190a42472dbce0260f1] | committer: Felix Paul Kühne 

osx/framework: don't interfere with the NSCell API and fail gracefully if pausing throws an exception

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

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

diff --git a/projects/macosx/framework/Sources/VLCMediaPlayer.m b/projects/macosx/framework/Sources/VLCMediaPlayer.m
index e609e01..8f887a5 100644
--- a/projects/macosx/framework/Sources/VLCMediaPlayer.m
+++ b/projects/macosx/framework/Sources/VLCMediaPlayer.m
@@ -433,7 +433,7 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
     catch_exception( &ex );
 }
 
-- (int)chapter
+- (int)currentChapter
 {
     libvlc_exception_t ex;
     libvlc_exception_init( &ex );
@@ -475,7 +475,7 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
     catch_exception( &ex );
 }
 
-- (int)title
+- (int)currentTitle
 {
     libvlc_exception_t ex;
     libvlc_exception_init( &ex );
@@ -583,7 +583,13 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
     libvlc_exception_t ex;
     libvlc_exception_init( &ex );
     libvlc_media_player_pause( (libvlc_media_player_t *)instance, &ex );
-    catch_exception( &ex );
+
+    // fail gracefully
+    // in most cases, it's just EOF so let's stop
+    if (libvlc_exception_raised(&ex))
+        [self stop];
+
+    libvlc_exception_clear(&ex);
 }
 
 - (void)stop




More information about the vlc-devel mailing list