From 3d87006f1a6a277bafa70f0382ff4c8336ef61d6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Felix=20Paul=20K=C3=BChne?= Date: Sun, 17 Jan 2010 22:08:33 +0100 Subject: [PATCH] osx/framework: handle exceptions if there are no SPUs --- .../macosx/framework/Sources/VLCMediaPlayer.m | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/projects/macosx/framework/Sources/VLCMediaPlayer.m b/projects/macosx/framework/Sources/VLCMediaPlayer.m index bad64b8d05..51b535eb8b 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 -- 2.39.2