Commit 4ea2ec4b authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

macosx/framework: Whitespaces cleanup.

parent 5aa0d7fd
...@@ -174,20 +174,20 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self) ...@@ -174,20 +174,20 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
} }
- (id)initWithURL:(NSURL *)anURL - (id)initWithURL:(NSURL *)anURL
{ {
if (self = [super init]) if (self = [super init])
{ {
libvlc_exception_t ex; libvlc_exception_t ex;
libvlc_exception_init(&ex); libvlc_exception_init(&ex);
p_md = libvlc_media_new([VLCLibrary sharedInstance], p_md = libvlc_media_new([VLCLibrary sharedInstance],
[[anURL absoluteString] UTF8String], [[anURL absoluteString] UTF8String],
&ex); &ex);
catch_exception(&ex); catch_exception(&ex);
delegate = nil; delegate = nil;
metaDictionary = [[NSMutableDictionary alloc] initWithCapacity:3]; metaDictionary = [[NSMutableDictionary alloc] initWithCapacity:3];
// This value is set whenever the demuxer figures out what the length is. // This value is set whenever the demuxer figures out what the length is.
// TODO: Easy way to tell the length of the movie without having to instiate the demuxer. Maybe cached info? // TODO: Easy way to tell the length of the movie without having to instiate the demuxer. Maybe cached info?
length = nil; length = nil;
...@@ -198,12 +198,12 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self) ...@@ -198,12 +198,12 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
} }
- (id)initAsNodeWithName:(NSString *)aName - (id)initAsNodeWithName:(NSString *)aName
{ {
if (self = [super init]) if (self = [super init])
{ {
libvlc_exception_t ex; libvlc_exception_t ex;
libvlc_exception_init(&ex); libvlc_exception_init(&ex);
p_md = libvlc_media_new_as_node([VLCLibrary sharedInstance], p_md = libvlc_media_new_as_node([VLCLibrary sharedInstance],
[aName UTF8String], [aName UTF8String],
&ex); &ex);
...@@ -211,11 +211,11 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self) ...@@ -211,11 +211,11 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
delegate = nil; delegate = nil;
metaDictionary = [[NSMutableDictionary alloc] initWithCapacity:3]; metaDictionary = [[NSMutableDictionary alloc] initWithCapacity:3];
// This value is set whenever the demuxer figures out what the length is. // This value is set whenever the demuxer figures out what the length is.
// TODO: Easy way to tell the length of the movie without having to instiate the demuxer. Maybe cached info? // TODO: Easy way to tell the length of the movie without having to instiate the demuxer. Maybe cached info?
length = nil; length = nil;
[self initInternalMediaDescriptor]; [self initInternalMediaDescriptor];
} }
return self; return self;
...@@ -275,11 +275,11 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self) ...@@ -275,11 +275,11 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
- (VLCTime *)length - (VLCTime *)length
{ {
if (!length) if (!length)
{ {
// Try figuring out what the length is // Try figuring out what the length is
long long duration = libvlc_media_get_duration( p_md, NULL ); long long duration = libvlc_media_get_duration( p_md, NULL );
if (duration > -1) if (duration > -1)
{ {
[self setLength:[VLCTime timeWithNumber:[NSNumber numberWithLongLong:duration]]]; [self setLength:[VLCTime timeWithNumber:[NSNumber numberWithLongLong:duration]]];
return [[length retain] autorelease]; return [[length retain] autorelease];
...@@ -342,14 +342,14 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self) ...@@ -342,14 +342,14 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
{ {
libvlc_media_retain( md ); libvlc_media_retain( md );
p_md = md; p_md = md;
metaDictionary = [[NSMutableDictionary alloc] initWithCapacity:3]; metaDictionary = [[NSMutableDictionary alloc] initWithCapacity:3];
[self initInternalMediaDescriptor]; [self initInternalMediaDescriptor];
} }
return self; return self;
} }
- (void *)libVLCMediaDescriptor - (void *)libVLCMediaDescriptor
{ {
return p_md; return p_md;
} }
...@@ -473,7 +473,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self) ...@@ -473,7 +473,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
// Only fetch the art if needed. (ie, create the NSImage, if it was requested before) // Only fetch the art if needed. (ie, create the NSImage, if it was requested before)
if (isArtFetched && [metaType isEqualToString:VLCMetaInformationArtworkURL]) if (isArtFetched && [metaType isEqualToString:VLCMetaInformationArtworkURL])
{ {
[NSThread detachNewThreadSelector:@selector(fetchMetaInformationForArtWorkWithURL:) [NSThread detachNewThreadSelector:@selector(fetchMetaInformationForArtWorkWithURL:)
toTarget:self toTarget:self
withObject:newValue]; withObject:newValue];
} }
...@@ -494,7 +494,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self) ...@@ -494,7 +494,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
// Don't attempt to fetch artwork from remote. Core will do that alone // Don't attempt to fetch artwork from remote. Core will do that alone
if ([artUrl isFileURL]) if ([artUrl isFileURL])
art = [[[NSImage alloc] initWithContentsOfURL:artUrl] autorelease]; art = [[[NSImage alloc] initWithContentsOfURL:artUrl] autorelease];
} }
// If anything was found, lets save it to the meta data dictionary // If anything was found, lets save it to the meta data dictionary
...@@ -553,6 +553,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self) ...@@ -553,6 +553,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
/* Force VLCMetaInformationTitle, that will trigger preparsing /* Force VLCMetaInformationTitle, that will trigger preparsing
* And all the other meta will be added through the libvlc event system */ * And all the other meta will be added through the libvlc event system */
[self fetchMetaInformationFromLibVLCWithType: VLCMetaInformationTitle]; [self fetchMetaInformationFromLibVLCWithType: VLCMetaInformationTitle];
} }
else if( !isArtURLFetched && [keyPath hasPrefix:@"metaDictionary.artworkURL"]) else if( !isArtURLFetched && [keyPath hasPrefix:@"metaDictionary.artworkURL"])
{ {
...@@ -561,7 +562,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self) ...@@ -561,7 +562,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
* And all the other meta will be added through the libvlc event system */ * And all the other meta will be added through the libvlc event system */
[self fetchMetaInformationFromLibVLCWithType: VLCMetaInformationArtworkURL]; [self fetchMetaInformationFromLibVLCWithType: VLCMetaInformationArtworkURL];
} }
return [super valueForKeyPath:keyPath]; return [super valueForKeyPath:keyPath];
} }
@end @end
...@@ -576,8 +577,8 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self) ...@@ -576,8 +577,8 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
{ {
if (length && value && [length compare:value] == NSOrderedSame) if (length && value && [length compare:value] == NSOrderedSame)
return; return;
[length release]; [length release];
length = value ? [value retain] : nil; length = value ? [value retain] : nil;
} }
......
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