From 16f0d75e4648bf14a3163e97fba9905ac79607e8 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 26 Mar 2011 14:50:14 +0000 Subject: WinGui: - Fix for the AutoName helper. Should now set the correct file extension based on the user preference. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3880 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/Functions/Main.cs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'win/CS/Functions') diff --git a/win/CS/Functions/Main.cs b/win/CS/Functions/Main.cs index 33491ed96..48f15bd6f 100644 --- a/win/CS/Functions/Main.cs +++ b/win/CS/Functions/Main.cs @@ -235,10 +235,21 @@ namespace Handbrake.Functions // Add the appropriate file extension if (mainWindow.drop_format.SelectedIndex == 0) { - destinationFilename += Properties.Settings.Default.useM4v == 0 || Properties.Settings.Default.useM4v == 2 || mainWindow.Check_ChapterMarkers.Checked || + switch (Properties.Settings.Default.useM4v) + { + case 0: // Automatic + destinationFilename += mainWindow.Check_ChapterMarkers.Checked || mainWindow.AudioSettings.RequiresM4V() || mainWindow.Subtitles.RequiresM4V() ? ".m4v" : ".mp4"; + break; + case 1: // Always MP4 + destinationFilename += ".mp4"; + break; + case 2: // Always M4V + destinationFilename += ".m4v"; + break; + } } else if (mainWindow.drop_format.SelectedIndex == 1) destinationFilename += ".mkv"; @@ -268,10 +279,6 @@ namespace Handbrake.Functions { // Use the path and change the file extension to match the previous destination autoNamePath = Path.Combine(Path.GetDirectoryName(mainWindow.text_destination.Text), destinationFilename); - - if (Path.HasExtension(mainWindow.text_destination.Text)) - autoNamePath = Path.ChangeExtension(autoNamePath, - Path.GetExtension(mainWindow.text_destination.Text)); } } -- cgit v1.2.3