[vlc-devel] commit: osx/framework: fixed a typo and enabled the framework to open external subtitle files ( Felix Paul Kühne )

git version control git at videolan.org
Mon Dec 21 01:23:47 CET 2009


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sun Dec 20 23:30:27 2009 +0100| [3154a8b75ed3b98baf06c4163882c5a2d3069f86] | committer: Felix Paul Kühne 

osx/framework: fixed a typo and enabled the framework to open external subtitle files

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

 .../framework/Headers/Public/VLCMediaPlayer.h      |    1 +
 projects/macosx/framework/Sources/VLCLibrary.m     |    6 +++---
 projects/macosx/framework/Sources/VLCMediaPlayer.m |   11 ++++++++++-
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/projects/macosx/framework/Headers/Public/VLCMediaPlayer.h b/projects/macosx/framework/Headers/Public/VLCMediaPlayer.h
index 420d2b4..043ca1b 100644
--- a/projects/macosx/framework/Headers/Public/VLCMediaPlayer.h
+++ b/projects/macosx/framework/Headers/Public/VLCMediaPlayer.h
@@ -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;
diff --git a/projects/macosx/framework/Sources/VLCLibrary.m b/projects/macosx/framework/Sources/VLCLibrary.m
index ccf5beb..413e2eb 100644
--- a/projects/macosx/framework/Sources/VLCLibrary.m
+++ b/projects/macosx/framework/Sources/VLCLibrary.m
@@ -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];
     }
diff --git a/projects/macosx/framework/Sources/VLCMediaPlayer.m b/projects/macosx/framework/Sources/VLCMediaPlayer.m
index a49b8c7..2609810 100644
--- a/projects/macosx/framework/Sources/VLCMediaPlayer.m
+++ b/projects/macosx/framework/Sources/VLCMediaPlayer.m
@@ -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;




More information about the vlc-devel mailing list