From f35c3d113308cf288376db1a6a342ed2b324f257 Mon Sep 17 00:00:00 2001 From: Aleksandr Pasechnik Date: Fri, 20 Mar 2015 20:51:46 -0400 Subject: [PATCH] enable the macosx GUI to handle negative stop-time MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Felix Paul Kühne --- modules/gui/macosx/misc.m | 2 +- modules/gui/macosx/open.m | 2 +- modules/gui/macosx/playlist.m | 2 +- modules/gui/macosx/wizard.m | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/gui/macosx/misc.m b/modules/gui/macosx/misc.m index 9769172172..b20ab77fff 100644 --- a/modules/gui/macosx/misc.m +++ b/modules/gui/macosx/misc.m @@ -867,7 +867,7 @@ void _drawFrameInRect(NSRect frameRect) { self = [super init]; NSMutableCharacterSet *nonNumbers = [[[NSCharacterSet decimalDigitCharacterSet] invertedSet] mutableCopy]; - [nonNumbers removeCharactersInString:@":"]; + [nonNumbers removeCharactersInString:@"-:"]; o_forbidden_characters = [nonNumbers copy]; [nonNumbers release]; diff --git a/modules/gui/macosx/open.m b/modules/gui/macosx/open.m index d37d497e08..c132793618 100644 --- a/modules/gui/macosx/open.m +++ b/modules/gui/macosx/open.m @@ -475,7 +475,7 @@ static VLCOpen *_o_sharedMainInstance = nil; tempValue = [[components objectAtIndex:0] intValue] * 60 + [[components objectAtIndex:1] intValue]; else if (componentCount == 3) tempValue = [[components objectAtIndex:0] intValue] * 3600 + [[components objectAtIndex:1] intValue] * 60 + [[components objectAtIndex:2] intValue]; - if (tempValue > 0) + if (tempValue != 0) [o_options addObject: [NSString stringWithFormat:@"stop-time=%li", tempValue]]; } if ([o_output_ckbox state] == NSOnState) { diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m index 825f1c298e..e29644a8bb 100644 --- a/modules/gui/macosx/playlist.m +++ b/modules/gui/macosx/playlist.m @@ -973,7 +973,7 @@ /* allow the user to over-write the start/stop/run-time */ if (var_GetFloat(p_input_thread, "run-time") > 0 || var_GetFloat(p_input_thread, "start-time") > 0 || - var_GetFloat(p_input_thread, "stop-time") > 0) { + var_GetFloat(p_input_thread, "stop-time") != 0) { return; } diff --git a/modules/gui/macosx/wizard.m b/modules/gui/macosx/wizard.m index e8c832fc6a..7db0503e9a 100644 --- a/modules/gui/macosx/wizard.m +++ b/modules/gui/macosx/wizard.m @@ -1232,7 +1232,7 @@ static VLCWizard *_o_sharedInstance = nil; time = 1000000 * ([[components objectAtIndex:0] intValue] * 3600 + [[components objectAtIndex:1] intValue] * 60 + [[components objectAtIndex:2] intValue]); else msg_Err(VLCIntf, "Invalid string format for time"); - input_item_AddOption(p_input, [[NSString stringWithFormat: @"stop-time=%lu", time] UTF8String], VLC_INPUT_OPTION_TRUSTED); + input_item_AddOption(p_input, [[NSString stringWithFormat: @"stop-time=%ld", time] UTF8String], VLC_INPUT_OPTION_TRUSTED); } input_item_AddOption( p_input, [[NSString stringWithFormat: -- 2.39.2