[vlc-devel] commit: osx/framework: handle exceptions if there are no SPUs ( Felix Paul Kühne )

git version control git at videolan.org
Sun Jan 17 22:09:45 CET 2010


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sun Jan 17 22:08:33 2010 +0100| [3d87006f1a6a277bafa70f0382ff4c8336ef61d6] | committer: Felix Paul Kühne 

osx/framework: handle exceptions if there are no SPUs

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

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

diff --git a/projects/macosx/framework/Sources/VLCMediaPlayer.m b/projects/macosx/framework/Sources/VLCMediaPlayer.m
index bad64b8..51b535e 100644
--- a/projects/macosx/framework/Sources/VLCMediaPlayer.m
+++ b/projects/macosx/framework/Sources/VLCMediaPlayer.m
@@ -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




More information about the vlc-devel mailing list