Commit 29f72ea1 authored by Marvin Scholz's avatar Marvin Scholz Committed by David
Browse files

macosx: use inputMetaWithPath where possible

parent 1d098b5d
......@@ -500,12 +500,12 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
for (NSUInteger i = 0; i < valueCount; i++) {
VLCOpenInputMetadata *inputMetadata;
char *psz_uri = vlc_path2uri([values[i] UTF8String], "file");
if (!psz_uri)
NSString *filepath = values[i];
inputMetadata = [VLCOpenInputMetadata inputMetaWithPath:filepath];
if (!inputMetadata)
continue;
inputMetadata = [[VLCOpenInputMetadata alloc] init];
inputMetadata.MRLString = toNSStr(psz_uri);
free(psz_uri);
[metadataArray addObject:inputMetadata];
}
[_playlistController addPlaylistItems:metadataArray];
......
......@@ -401,14 +401,14 @@ static VLCMain *sharedInstance = nil;
NSArray *o_sorted_names = [resultItems sortedArrayUsingSelector: @selector(caseInsensitiveCompare:)];
NSMutableArray *o_result = [NSMutableArray arrayWithCapacity: [o_sorted_names count]];
for (NSUInteger i = 0; i < [o_sorted_names count]; i++) {
char *psz_uri = vlc_path2uri([[o_sorted_names objectAtIndex:i] UTF8String], "file");
if (!psz_uri)
VLCOpenInputMetadata *inputMetadata;
NSString *filepath = [o_sorted_names objectAtIndex:i];
inputMetadata = [VLCOpenInputMetadata inputMetaWithPath:filepath];
if (!inputMetadata)
continue;
VLCOpenInputMetadata *o_inputMetadata = [[VLCOpenInputMetadata alloc] init];
o_inputMetadata.MRLString = toNSStr(psz_uri);
[o_result addObject: o_inputMetadata];
free(psz_uri);
[o_result addObject:inputMetadata];
}
[_playlistController addPlaylistItems:o_result];
......
......@@ -554,12 +554,11 @@ NSString *const VLCOpenTextFieldWasClicked = @"VLCOpenTextFieldWasClicked";
for (NSUInteger i = 0; i < count; i++) {
VLCOpenInputMetadata *inputMetadata;
char *psz_uri = vlc_path2uri([[values objectAtIndex:i] UTF8String], "file");
if (!psz_uri)
NSString *filepath = [values objectAtIndex:i];
inputMetadata = [VLCOpenInputMetadata inputMetaWithPath:filepath];
if (!inputMetadata)
continue;
inputMetadata = [[VLCOpenInputMetadata alloc] init];
inputMetadata.MRLString = toNSStr(psz_uri);
free(psz_uri);
[array addObject:inputMetadata];
}
......
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