]> git.sesse.net Git - vlc/commitdiff
osx/framework: fixed a typo and enabled the framework to open external subtitle files
authorFelix Paul Kühne <fkuehne@videolan.org>
Sun, 20 Dec 2009 22:30:27 +0000 (23:30 +0100)
committerFelix Paul Kühne <fkuehne@videolan.org>
Mon, 21 Dec 2009 00:23:44 +0000 (01:23 +0100)
projects/macosx/framework/Headers/Public/VLCMediaPlayer.h
projects/macosx/framework/Sources/VLCLibrary.m
projects/macosx/framework/Sources/VLCMediaPlayer.m

index 420d2b4d692406b16536e78c64ae311bc51108db..043ca1bbbfd95d8760ac6d34a63e125712a8549b 100644 (file)
@@ -108,6 +108,7 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
 - (void)setVideoSubTitles:(int)value;
 - (int)countOfVideoSubTitles;
 - (int)currentVideoSubTitles;
+- (BOOL)openVideoSubTitlesFromFile:(NSString *)path;
 
 - (void)setVideoCropGeometry:(char *)value;
 - (char *)videoCropGeometry;
index ccf5beb9aa6af32b555e2ce8ae132be5df905734..413e2ebb9d8aa352bbeccef59fc91d4345a389b2 100644 (file)
@@ -76,12 +76,12 @@ void __catch_exception( void * e, const char * function, const char * file, int
             [defaultParams addObject:@"--ignore-config"];                           // Don't read and write VLC config files
             [defaultParams addObject:@"--opengl-provider=minimal_macosx"];          // Use minimal_macosx
             [defaultParams addObject:@"--vout=minimal_macosx"];
+            [defaultParams addObject:@"--text-renderer=quartztext"];                // our CoreText-based renderer
             [defaultParams addObject:@"--verbose=2"];                               // Don't polute the log
-            [defaultParams addObject:@"--vout=minimal_macosx"];
             [defaultParams addObject:@"--no-color"];
             vlcParams = defaultParams;
         }
-    
+
         int paramNum = 0;
         const char *lib_vlc_params[[vlcParams count]];
         while (paramNum < [vlcParams count]) {
@@ -92,7 +92,7 @@ void __catch_exception( void * e, const char * function, const char * file, int
         instance = (void *)libvlc_new( sizeof(lib_vlc_params)/sizeof(lib_vlc_params[0]), lib_vlc_params, &ex );
         catch_exception( &ex );
         NSAssert(instance, @"libvlc failed to initialize");
-        
+
         // Assignment unneeded, as the audio unit will do it for us
         /*audio = */ [[VLCAudio alloc] initWithLibrary:self];
     }
index a49b8c72000187bcb3c7f1df75b7de29bb9bb2e7..260981013eb2ca14ffaeb0dee2f8653b1b6bd0bd 100644 (file)
@@ -287,7 +287,7 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
 {
     libvlc_exception_t ex;
     libvlc_exception_init( &ex );
-    int result = libvlc_video_get_spu( instance, &ex );
+    int result = libvlc_video_get_spu_count( instance, &ex );
     catch_exception( &ex );
     return result;
 }
@@ -309,6 +309,15 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
     }
 }
 
+- (BOOL)openVideoSubTitlesFromFile:(NSString *)path
+{
+    libvlc_exception_t ex;
+    libvlc_exception_init( &ex );
+    BOOL result = libvlc_video_set_subtitle_file( instance, [path UTF8String], &ex );
+    catch_exception( &ex );
+    return result;
+}
+
 - (void)setVideoCropGeometry:(char *)value
 {
     libvlc_exception_t ex;