]> git.sesse.net Git - vlc/commitdiff
osx/framework: handle exceptions if there are no SPUs
authorFelix Paul Kühne <fkuehne@videolan.org>
Sun, 17 Jan 2010 21:08:33 +0000 (22:08 +0100)
committerFelix Paul Kühne <fkuehne@videolan.org>
Sun, 17 Jan 2010 21:09:35 +0000 (22:09 +0100)
projects/macosx/framework/Sources/VLCMediaPlayer.m

index bad64b8d05afade2724b9383e0ecac288143de3d..51b535eb8b6adb20f9160402c1de366489eb32fa 100644 (file)
@@ -288,12 +288,21 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s
     libvlc_exception_t ex;
     libvlc_exception_init( &ex );
     NSInteger count = libvlc_video_get_spu_count( instance, &ex );
-    catch_exception( &ex );
+    if (libvlc_exception_raised( &ex ))
+    {
+        libvlc_exception_clear( &ex );
+        return NSNotFound;
+    }
     if (count <= 0)
         return NSNotFound;
     NSUInteger result = libvlc_video_get_spu( instance, &ex );
-    catch_exception( &ex );
-    return result;
+    if (libvlc_exception_raised( &ex ))
+    {
+        libvlc_exception_clear( &ex );
+        return NSNotFound;
+    }
+    else
+        return result;
 }
 
 - (BOOL)openVideoSubTitlesFromFile:(NSString *)path