From 6b27ad9561e9c1262658d825ae6c6fd84388376e Mon Sep 17 00:00:00 2001 From: dynaflash Date: Tue, 28 Dec 2010 17:52:00 +0000 Subject: [PATCH] MacGui: Fix popup and output file extension inconsistency. Patch by Rodeo. Thanks! - Issue with mis matching formats and extensions described here http://forum.handbrake.fr/viewtopic.php?f=4&t=19001 . git-svn-id: svn://localhost/HandBrake/trunk@3717 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- macosx/Controller.m | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/macosx/Controller.m b/macosx/Controller.m index a72abcf9..3764e189 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -1858,6 +1858,14 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It } [fSrcDVD2Field setStringValue:browsedSourceDisplayName]; + // use the correct extension based on the container + int format = [fDstFormatPopUp indexOfSelectedItem]; + char *ext = "mp4"; + if (format == 1) + { + ext = "mkv"; + } + /* If its a queue rescan for edit, get the queue item output path */ /* if not, its a new source scan. */ /* Check to see if the last destination has been set,use if so, if not, use Desktop */ @@ -1868,12 +1876,18 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It else if ([[NSUserDefaults standardUserDefaults] stringForKey:@"LastDestinationDirectory"]) { [fDstFile2Field setStringValue: [NSString stringWithFormat: - @"%@/%@.mp4", [[NSUserDefaults standardUserDefaults] stringForKey:@"LastDestinationDirectory"],[browsedSourceDisplayName stringByDeletingPathExtension]]]; + @"%@/%@.%s", [[NSUserDefaults standardUserDefaults] stringForKey:@"LastDestinationDirectory"],[browsedSourceDisplayName stringByDeletingPathExtension],ext]]; } else { [fDstFile2Field setStringValue: [NSString stringWithFormat: - @"%@/Desktop/%@.mp4", NSHomeDirectory(),[browsedSourceDisplayName stringByDeletingPathExtension]]]; + @"%@/Desktop/%@.%s", NSHomeDirectory(),[browsedSourceDisplayName stringByDeletingPathExtension],ext]]; + } + + // set m4v extension if necessary - do not override user-specified .mp4 extension + if (format == 0 && applyQueueToScan != YES) + { + [self autoSetM4vExtension: sender]; } /* See if this is the main feature according to libhb */ -- 2.11.0