]> granicus.if.org Git - handbrake/commitdiff
WinGui:
authorsr55 <sr55.hb@outlook.com>
Sat, 26 Mar 2011 14:50:14 +0000 (14:50 +0000)
committersr55 <sr55.hb@outlook.com>
Sat, 26 Mar 2011 14:50:14 +0000 (14:50 +0000)
- 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

index 33491ed963ed9af6428e508ca7d98e91d05947fe..48f15bd6f3ebcd669719e3446770a922f224ad99 100644 (file)
@@ -235,10 +235,21 @@ namespace Handbrake.Functions
                 // Add the appropriate file extension\r
                 if (mainWindow.drop_format.SelectedIndex == 0)\r
                 {\r
-                    destinationFilename += Properties.Settings.Default.useM4v == 0 || Properties.Settings.Default.useM4v == 2 || mainWindow.Check_ChapterMarkers.Checked ||\r
+                    switch (Properties.Settings.Default.useM4v)\r
+                    {\r
+                        case 0: // Automatic\r
+                            destinationFilename += mainWindow.Check_ChapterMarkers.Checked ||\r
                                            mainWindow.AudioSettings.RequiresM4V() || mainWindow.Subtitles.RequiresM4V()\r
                                                ? ".m4v"\r
                                                : ".mp4";\r
+                            break;\r
+                        case 1: // Always MP4\r
+                            destinationFilename += ".mp4";\r
+                            break;\r
+                        case 2: // Always M4V\r
+                            destinationFilename += ".m4v";\r
+                            break;\r
+                    }                   \r
                 }\r
                 else if (mainWindow.drop_format.SelectedIndex == 1)\r
                     destinationFilename += ".mkv";\r
@@ -268,10 +279,6 @@ namespace Handbrake.Functions
                 {\r
                     // Use the path and change the file extension to match the previous destination\r
                     autoNamePath = Path.Combine(Path.GetDirectoryName(mainWindow.text_destination.Text), destinationFilename);\r
-\r
-                    if (Path.HasExtension(mainWindow.text_destination.Text))\r
-                        autoNamePath = Path.ChangeExtension(autoNamePath,\r
-                                                            Path.GetExtension(mainWindow.text_destination.Text));\r
                 }\r
             }\r
 \r