]> git.sesse.net Git - vlc/commitdiff
macosx: fix custom playback options (close #8543)
authorFelix Paul Kühne <fkuehne@videolan.org>
Thu, 2 May 2013 09:42:13 +0000 (11:42 +0200)
committerFelix Paul Kühne <fkuehne@videolan.org>
Thu, 2 May 2013 09:42:13 +0000 (11:42 +0200)
modules/gui/macosx/open.m

index 872748b11b65dbedd039e5fddb09da7446ca463b..8502ca52e1b148d5680e23288e47ba71793e438d 100644 (file)
@@ -453,27 +453,29 @@ static VLCOpen *_o_sharedMainInstance = nil;
                     p_item->list.i[[o_file_sub_size_pop indexOfSelectedItem]]]];
             }
         }
-        NSArray * components = [[o_file_starttime_fld stringValue] componentsSeparatedByString:@":"];
-        NSUInteger componentCount = [components count];
-        NSInteger tempValue;
-        if (componentCount == 1)
-            tempValue = 1000000 * ([components[0] intValue]);
-        else if (componentCount == 2)
-            tempValue = 1000000 * ([components[0] intValue] * 60 + [components[1] intValue]);
-        else if (componentCount == 3)
-            tempValue = 1000000 * ([components[0] intValue] * 3600 + [components[1] intValue] * 60 + [components[2] intValue]);
-        if (tempValue > 0)
-            [o_options addObject: [NSString stringWithFormat:@"start-time=%li", tempValue]];
-        components = [[o_file_stoptime_fld stringValue] componentsSeparatedByString:@":"];
-        componentCount = [components count];
-        if (componentCount == 1)
-            tempValue = 1000000 * ([components[0] intValue]);
-        else if (componentCount == 2)
-            tempValue = 1000000 * ([components[0] intValue] * 60 + [components[1] intValue]);
-        else if (componentCount == 3)
-            tempValue = 1000000 * ([components[0] intValue] * 3600 + [components[1] intValue] * 60 + [components[2] intValue]);
-        if (tempValue > 0)
-            [o_options addObject: [NSString stringWithFormat:@"stop-time=%li", tempValue]];
+        if ([o_file_custom_timing_ckb state] == NSOnState) {
+            NSArray * components = [[o_file_starttime_fld stringValue] componentsSeparatedByString:@":"];
+            NSUInteger componentCount = [components count];
+            NSInteger tempValue;
+            if (componentCount == 1)
+                tempValue = [components[0] intValue];
+            else if (componentCount == 2)
+                tempValue = [components[0] intValue] * 60 + [components[1] intValue];
+            else if (componentCount == 3)
+                tempValue = [components[0] intValue] * 3600 + [components[1] intValue] * 60 + [components[2] intValue];
+            if (tempValue > 0)
+                [o_options addObject: [NSString stringWithFormat:@"start-time=%li", tempValue]];
+            components = [[o_file_stoptime_fld stringValue] componentsSeparatedByString:@":"];
+            componentCount = [components count];
+            if (componentCount == 1)
+                tempValue = [components[0] intValue];
+            else if (componentCount == 2)
+                tempValue = [components[0] intValue] * 60 + [components[1] intValue];
+            else if (componentCount == 3)
+                tempValue = [components[0] intValue] * 3600 + [components[1] intValue] * 60 + [components[2] intValue];
+            if (tempValue > 0)
+                [o_options addObject: [NSString stringWithFormat:@"stop-time=%li", tempValue]];
+        }
         if ([o_output_ckbox state] == NSOnState) {
             NSArray * soutMRL = [o_sout_options soutMRL];
             NSUInteger count = [soutMRL count];