Commit 3d87006f authored by Felix Paul Kühne's avatar Felix Paul Kühne

osx/framework: handle exceptions if there are no SPUs

parent ed02d7a9
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment