]> git.sesse.net Git - vlc/commitdiff
osx/framework: don't interfere with the NSCell API and fail gracefully if pausing...
authorFelix Paul Kühne <fkuehne@videolan.org>
Sun, 20 Dec 2009 16:16:19 +0000 (17:16 +0100)
committerFelix Paul Kühne <fkuehne@videolan.org>
Mon, 21 Dec 2009 00:23:44 +0000 (01:23 +0100)
projects/macosx/framework/Sources/VLCMediaPlayer.m

index e609e013882c46263f2c79bcb93677a126f89dde..8f887a5acb5c171e167ed5d768a98ec2ba62391e 100644 (file)
@@ -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