Commit ca28163f authored by David Fuhrmann's avatar David Fuhrmann

macosx: fix crash in str_format_meta

(cherry picked from commit e823a595a8aa041de17e23d8f84bcb90d5d48702)
Signed-off-by: default avatarDavid Fuhrmann <dfuhrmann@videolan.org>
parent cc5786b1
......@@ -258,12 +258,14 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
return nil;
}
NSString *o_name;
NSString *o_name = @"";
char *format = var_InheritString(VLCIntf, "input-title-format");
char *formated = str_format_meta(p_input, format);
free(format);
o_name = [NSString stringWithUTF8String:formated];
free(formated);
if (format) {
char *formated = str_format_meta(p_input, format);
free(format);
o_name = toNSStr(formated);
free(formated);
}
NSURL * o_url = [NSURL URLWithString:[NSString stringWithUTF8String:psz_uri]];
free(psz_uri);
......
......@@ -695,14 +695,16 @@ static VLCMainWindow *_o_sharedInstance = nil;
input_thread_t * p_input;
p_input = pl_CurrentInput(VLCIntf);
if (p_input) {
NSString *aString;
NSString *aString = @"";
if (!config_GetPsz(VLCIntf, "video-title")) {
char *format = var_InheritString(VLCIntf, "input-title-format");
char *formated = str_format_meta(p_input, format);
free(format);
aString = [NSString stringWithUTF8String:formated];
free(formated);
if (format) {
char *formated = str_format_meta(p_input, format);
free(format);
aString = toNSStr(formated);
free(formated);
}
} else
aString = [NSString stringWithUTF8String:config_GetPsz(VLCIntf, "video-title")];
......
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