Commit b0620aea authored by Sebastien Zwickert's avatar Sebastien Zwickert Committed by Jean-Baptiste Kempf

gui/macosx: set URL instead of path to ITEM_URL. Fixes #3706

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit d3ed6bcb51d1bf13be1f035239e085fca3910645)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 75358c53
......@@ -33,6 +33,7 @@
#include <vlc_common.h>
#include <vlc_keys.h>
#include <vlc_dialog.h>
#include <vlc_url.h>
#include <unistd.h> /* execl() */
#import "intf.h"
......@@ -1044,7 +1045,14 @@ static NSString * VLCToolbarMediaControl = @"VLCToolbarMediaControl";
- (BOOL)application:(NSApplication *)o_app openFile:(NSString *)o_filename
{
BOOL b_autoplay = config_GetInt( VLCIntf, "macosx-autoplay" );
NSDictionary *o_dic = [NSDictionary dictionaryWithObjectsAndKeys: o_filename, @"ITEM_URL", nil];
char *psz_uri = make_URI([o_filename UTF8String]);
if( !psz_uri )
return( FALSE );
NSDictionary *o_dic = [NSDictionary dictionaryWithObject:[NSString stringWithCString:psz_uri encoding:NSUTF8StringEncoding] forKey:@"ITEM_URL"];
free( psz_uri );
if( b_autoplay )
[o_playlist appendArray: [NSArray arrayWithObject: o_dic] atPos: -1 enqueue: NO];
else
......
......@@ -963,7 +963,14 @@ static VLCOpen *_o_sharedMainInstance = nil;
for( i = 0; i < (int)[o_values count]; i++)
{
NSDictionary *o_dic;
o_dic = [NSDictionary dictionaryWithObject:[o_values objectAtIndex:i] forKey:@"ITEM_URL"];
char *psz_uri = make_URI([[o_values objectAtIndex:i] UTF8String]);
if( !psz_uri )
continue;
o_dic = [NSDictionary dictionaryWithObject:[NSString stringWithCString:psz_uri encoding:NSUTF8StringEncoding] forKey:@"ITEM_URL"];
free( psz_uri );
o_array = [o_array arrayByAddingObject: o_dic];
}
if( b_autoplay )
......
......@@ -54,6 +54,8 @@
#import <vlc_osd.h>
#import <vlc_interface.h>
#include <vlc_url.h>
/*****************************************************************************
* VLCPlaylistView implementation
......@@ -1779,8 +1781,14 @@
for( i = 0; i < (int)[o_values count]; i++)
{
NSDictionary *o_dic;
o_dic = [NSDictionary dictionaryWithObject:[o_values
objectAtIndex:i] forKey:@"ITEM_URL"];
char *psz_uri = make_URI([[o_values objectAtIndex:i] UTF8String]);
if( !psz_uri )
continue;
o_dic = [NSDictionary dictionaryWithObject:[NSString stringWithCString:psz_uri encoding:NSUTF8StringEncoding] forKey:@"ITEM_URL"];
free( psz_uri );
o_array = [o_array arrayByAddingObject: o_dic];
}
......
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