Kaynağa Gözat

framework: Fix the configure script. Fix a bunch of warnings.

Pierre d'Herbemont 17 yıl önce
ebeveyn
işleme
75dce6c347

+ 4 - 4
Headers/Public/VLCMedia.h

@@ -189,7 +189,7 @@ typedef enum VLCMediaState
  * available.  Use lengthWaitUntilDate: to wait for a specified length of time.
  * \see lengthWaitUntilDate
  */
-@property (readonly) VLCTime * length;
+@property (retain, readonly) VLCTime * length;
 
 /**
  * Returns a VLCTime object describing the length of the media resource,
@@ -209,17 +209,17 @@ typedef enum VLCMediaState
 /**
  * The URL for the receiver's media resource.
  */
-@property (readonly) NSURL * url;
+@property (retain, readonly) NSURL * url;
 
 /**
  * The receiver's sub list.
  */
-@property (readonly) VLCMediaList * subitems;
+@property (retain, readonly) VLCMediaList * subitems;
 
 /**
  * The receiver's meta data as a NSDictionary object.
  */
-@property (readonly) NSDictionary * metaDictionary;
+@property (retain, readonly) NSDictionary * metaDictionary;
 
 /**
  * The receiver's state, such as Playing, Error, NothingSpecial, Buffering.

+ 1 - 1
Sources/VLCLibrary.m

@@ -82,7 +82,7 @@ static void * DestroySharedLibraryAtExit( void )
         
         const char * lib_vlc_params[] = { 
             "-I", "dummy", "--vout=opengllayer", 
-            "--no-video-title-show", "--no-sout-keep", "-vvv"
+            "--no-video-title-show", "--no-sout-keep"
             //, "--control=motion", "--motion-use-rotate", "--video-filter=rotate"
         };
         

+ 23 - 10
Sources/VLCMedia.m

@@ -358,7 +358,6 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
     p_md = libvlc_media_descriptor_duplicate( [media libVLCMediaDescriptor] );
     for( NSString * key in [options allKeys] )
     {
-        NSLog(@"Adding %@", [NSString stringWithFormat:@"--%@ %@", key, [options objectForKey:key]]);
         libvlc_media_descriptor_add_option(p_md, [[NSString stringWithFormat:@"%@=#%@", key, [options objectForKey:key]] UTF8String], NULL);
     }
     return [VLCMedia mediaWithLibVLCMediaDescriptor:p_md];
@@ -460,9 +459,13 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
     }
 
     state = LibVLCStateToMediaState(libvlc_media_descriptor_get_state( p_md, NULL ));
+
     /* Force VLCMetaInformationTitle, that will trigger preparsing
      * And all the other meta will be added through the libvlc event system */
     [self fetchMetaInformationFromLibVLCWithType: VLCMetaInformationTitle];
+
+    /* Force VLCMetaInformationArtworkURL, that will trigger artwork fetching */
+    [self fetchMetaInformationFromLibVLCWithType: VLCMetaInformationArtworkURL];
 }
 
 - (void)fetchMetaInformationFromLibVLCWithType:(NSString *)metaType
@@ -472,7 +475,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
     NSString * oldValue = [metaDictionary valueForKey:metaType];
     free(psz_value);
 
-    if ( !(newValue && oldValue && [oldValue compare:newValue] == NSOrderedSame) )
+    if ( newValue != oldValue && !(oldValue && newValue && [oldValue compare:newValue] == NSOrderedSame) )
     {
         if ([metaType isEqualToString:VLCMetaInformationArtworkURL])
         {
@@ -489,22 +492,32 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
 - (void)fetchMetaInformationForArtWorkWithURL:(NSString *)anURL
 {
     NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
-    
-    // Go ahead and load up the art work
-    NSURL * artUrl = [NSURL URLWithString:[anURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
-    NSImage * art  = [[[NSImage alloc] initWithContentsOfURL:artUrl] autorelease]; 
-        
-    // If anything was found, lets save it to the meta data dictionary
-    if (art)
+    NSImage * art = nil;
+
+    if( anURL )
     {
-        [self performSelectorOnMainThread:@selector(setArtwork:) withObject:art waitUntilDone:NO];
+        // Go ahead and load up the art work
+        NSURL * artUrl = [NSURL URLWithString:[anURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
+
+        // Don't attempt to fetch artwork from remote. Core will do that alone
+        if ([artUrl isFileURL])
+            art  = [[[NSImage alloc] initWithContentsOfURL:artUrl] autorelease]; 
     }
 
+    // If anything was found, lets save it to the meta data dictionary
+    [self performSelectorOnMainThread:@selector(setArtwork:) withObject:art waitUntilDone:NO];
+
     [pool release];
 }
 
 - (void)setArtwork:(NSImage *)art
 {
+    if (!art)
+    {
+        [metaDictionary removeObjectForKey:@"artwork"];
+        return;
+    }
+
     [metaDictionary setObject:art forKey:@"artwork"];
 }
 

+ 8 - 0
Sources/VLCVideoLayer.m

@@ -94,7 +94,11 @@
     [self setNeedsDisplayOnBoundsChange:YES];
 
     [CATransaction commit];
+
+    /* Trigger by hand, as it doesn't go through else. Assumed bug from Cocoa */
+    [self willChangeValueForKey:@"hasVideo"];
     self.hasVideo = YES;
+    [self didChangeValueForKey:@"hasVideo"];
 }
 
 - (void)removeVoutLayer:(CALayer*)voutLayer
@@ -102,7 +106,11 @@
     [CATransaction begin];
     [voutLayer removeFromSuperlayer];
     [CATransaction commit];
+    
+    /* Trigger by hand, as it doesn't go through else. Assumed bug from Cocoa */
+    [self willChangeValueForKey:@"hasVideo"];
     self.hasVideo = NO;
+    [self didChangeValueForKey:@"hasVideo"];
 }
 
 @end

+ 2 - 2
VLCKit.xcodeproj/project.pbxproj

@@ -430,7 +430,7 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "top_srcdir=`pwd`/../../..\n\nif test $ACTION = \"clean\"\nthen\n    rm -f $SYMROOT/vlc_build_dir/CMakeLists.txt\n    exit 0\nfi\n\necho \"$SRCROOT/../../../CMakeLists.txt doesn't exists\"\ncd $top_srcdir && ./extras/buildsystem/cmake/scripts/convert_vlc_to_cmake.sh\n";
+			shellScript = "top_srcdir=`pwd`/../../..\n\nif test $ACTION = \"clean\"\nthen\n    rm -f $SYMROOT/vlc_build_dir/CMakeLists.txt\n    exit 0\nfi\n\ncd $top_srcdir && ./extras/buildsystem/cmake/scripts/convert_vlc_to_cmake.sh\n";
 			showEnvVarsInLog = 0;
 		};
 		633BD6E30D2ADF030012A314 /* ShellScript */ = {
@@ -475,7 +475,7 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "echo $ACTION\nif test $ACTION = \"clean\"\nthen\n\trm -Rf $SYMROOT/vlc_build_dir\n     exit 0\nfi\n\ntop_srcdir=`pwd`/../../..\n\nif ! test -e $SYMROOT/vlc_build_dir/CMakeCache.txt\nthen\n\tmkdir -p $SYMROOT/vlc_build_dir\n\trm -Rf $top_srcdir/CMakeCache.txt\n\tcd $SYMROOT/vlc_build_dir && $top_srcdir/extras/contrib/bin/cmake $top_srcdir -DENABLE_NO_SYMBOL_CHECK=ON\nfi";
+			shellScript = "if test $ACTION = \"clean\"\nthen\n\trm -Rf $SYMROOT/vlc_build_dir\n     exit 0\nfi\n\ntop_srcdir=`pwd`/../../..\n\nif ! test -e $SYMROOT/vlc_build_dir/CMakeCache.txt\nthen\n\tmkdir -p $SYMROOT/vlc_build_dir\n\trm -Rf $top_srcdir/CMakeCache.txt\n\tcd $SYMROOT/vlc_build_dir && $top_srcdir/extras/contrib/bin/cmake $top_srcdir -DENABLE_NO_SYMBOL_CHECK=ON\nfi";
 			showEnvVarsInLog = 0;
 		};
 		EF78BD2E0CAEEF9500354E6E /* ShellScript */ = {