diff options
author | dynaflash <[email protected]> | 2011-01-19 22:35:46 +0000 |
---|---|---|
committer | dynaflash <[email protected]> | 2011-01-19 22:35:46 +0000 |
commit | 0d0845ba565911dea50d1869e4e33bfdc906989f (patch) | |
tree | 90b886608c4f06a86dc856a3d81c05a7edae6870 /macosx/Controller.m | |
parent | 10aed84471d4e0bacd1adb6842f1b921fbb36b73 (diff) |
MacGui: In Preferences, Instead of the old "Use iTunes / iPod friendly file extension for mp4" checkbox we allow three choices:
- Auto (Default): will use .mp4 unless any of the conditions are met for Apple devices to use .m4v such as AC3 audio or chapters, etc.
- .m4v: will set the extension to .m4v regardless of settings.
- .mp4: will set the extension to .mp4 regardless of settings.
Basically anything other than Auto forces either the .m4v or .mp4 file extension. Again "Auto" is default.
Note: This deprecates the old preferences plist key "DefaultMpegName" which was just a bool and adds "DefaultMpegExtension" which is a string. As a result users that had the old "Use iPod/iTunes friendly (.m4v) file extension for MP4" checkbox checked will need to select ".m4v" in the new preferences dialogue.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3758 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/Controller.m')
-rw-r--r-- | macosx/Controller.m | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/macosx/Controller.m b/macosx/Controller.m index aa0299b67..a744ad21c 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -4484,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]; @@ -4570,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 |