X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=macosx%2FController.m;h=a744ad21c824aaa117b5153805a125d933466491;hb=92a6427d5319576aa5717018afd09a639dab7e36;hp=78d99280da978fc4f64196188f27ec5ef9b39cac;hpb=c03095d94fe218d25be1e9c8b4f1812d1c591b19;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/macosx/Controller.m b/macosx/Controller.m index 78d99280..a744ad21 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 */ @@ -2578,9 +2592,9 @@ fWorkingCount = 0; [self writeToActivityLog: "scanning specifically for title: %d", scanTitleNum]; } - /* We use our advance pref to determine how many previews to scan */ - int hb_num_previews = [[[NSUserDefaults standardUserDefaults] objectForKey:@"PreviewsNumber"] intValue]; - hb_scan( fQueueEncodeLibhb, [path UTF8String], scanTitleNum, hb_num_previews, 0 , 0 ); + /* Only scan 10 previews before an encode - additional previews are only useful for autocrop and static previews, + * which are already taken care of at this point */ + hb_scan( fQueueEncodeLibhb, [path UTF8String], scanTitleNum, 10, 0, 0 ); } } @@ -4470,15 +4484,7 @@ bool one_burned = FALSE; switch( format ) { case 0: - /*Get Default MP4 File Extension*/ - if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultMpegName"] > 0) - { - ext = "m4v"; - } - else - { - ext = "mp4"; - } + [self autoSetM4vExtension: nil]; /* Add additional video encoders here */ menuItem = [[fVidEncoderPopUp menu] addItemWithTitle:@"H.264 (x264)" action: NULL keyEquivalent: @""]; [menuItem setTag: HB_VCODEC_X264]; @@ -4556,22 +4562,23 @@ bool one_burned = FALSE; { if ( [fDstFormatPopUp indexOfSelectedItem] ) return; - + NSString * extension = @"mp4"; - + BOOL anyCodecAC3 = [fAudioDelegate anyCodecMatches: HB_ACODEC_AC3] || [fAudioDelegate anyCodecMatches: HB_ACODEC_AC3_PASS]; - if (YES == anyCodecAC3 || - [fCreateChapterMarkers state] == NSOnState || - [[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultMpegName"] > 0 ) + + if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"DefaultMpegExtension"] isEqualToString: @".m4v"] || + ((YES == anyCodecAC3 || [fCreateChapterMarkers state] == NSOnState) && + [[[NSUserDefaults standardUserDefaults] objectForKey:@"DefaultMpegExtension"] isEqualToString: @"Auto"] )) { extension = @"m4v"; } - + if( [extension isEqualTo: [[fDstFile2Field stringValue] pathExtension]] ) return; else [fDstFile2Field setStringValue: [NSString stringWithFormat:@"%@.%@", - [[fDstFile2Field stringValue] stringByDeletingPathExtension], extension]]; + [[fDstFile2Field stringValue] stringByDeletingPathExtension], extension]]; } /* Method to determine if we should change the UI @@ -4788,6 +4795,12 @@ the user is using "Custom" settings by determining the sender*/ { [fVidQualityRFField setStringValue: [NSString stringWithFormat: @"%.2f", sliderRfInverse]]; } + /* Show a warning if x264 and rf 0 which is lossless */ + if ([[fVidEncoderPopUp selectedItem] tag] == HB_VCODEC_X264 && sliderRfInverse == 0.0) + { + [fVidQualityRFField setStringValue: [NSString stringWithFormat: @"%.2f (Warning: Lossless)", sliderRfInverse]]; + } + [self customSettingUsed: sender]; }