* 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,
/**
* 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.
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"
};
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];
}
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
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])
{
- (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"];
}
[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
[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
);
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 */ = {
);
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 */ = {