]> granicus.if.org Git - handbrake/commitdiff
WinGui: Couple Corrections to the Audiobitrate converter.
authorsr55 <sr55.hb@outlook.com>
Sat, 8 Sep 2012 18:16:46 +0000 (18:16 +0000)
committersr55 <sr55.hb@outlook.com>
Sat, 8 Sep 2012 18:16:46 +0000 (18:16 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4941 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs
win/CS/HandBrakeWPF/Converters/Audio/AudioBitrateConverter.cs
win/CS/HandBrakeWPF/Views/AudioView.xaml

index fedeb275f6a548ef006022ef12e42bbc6537912a..830cea25e756ac743854a5df2f6fa9691a17d303 100644 (file)
@@ -338,7 +338,7 @@ namespace HandBrake.ApplicationServices.Model.Encoding
         /// <summary>\r
         /// Gets a value indicating whether can set bitrate.\r
         /// </summary>\r
-        public bool CanSetBitrate\r
+        public bool CannotSetBitrate\r
         {\r
             get\r
             {\r
index 28bbf81acc45feef0c0a340af6f0e2ad2f218fd5..f4e805957500cb0e31341dba683dc084ec68d878 100644 (file)
@@ -80,26 +80,19 @@ namespace HandBrakeWPF.Converters.Audio
                         break;\r
                     case AudioEncoder.ffaac:\r
                         low = ((channels + lfeCount) * 32);\r
-                        max = ((channels + lfeCount) *\r
-                                 ((192 + (64 * ((samplerate << srShift) >= 44100 ? 1 : 0)))\r
-                                  >> srShift));\r
+                        max = ((channels + lfeCount) * ((192 + (64 * ((samplerate << srShift) >= 44100 ? 1 : 0))) >> srShift));\r
                         break;\r
                     case AudioEncoder.Lame:\r
                         low = 8 + (24 * (srShift < 1 ? 1 : 0) );\r
                         max = 64 + (96 * (srShift < 2 ? 1 : 0)) + (160 * (srShift < 1 ? 1 : 0));\r
                         break;\r
                     case AudioEncoder.Vorbis:\r
-                        low = (channels + lfeCount) * (14 +\r
-                            (8 * (srShift < 2 ? 1 : 0)) +\r
-                                              (6 * (srShift < 1 ? 1 : 0)));\r
-                        max = (channels + lfeCount) * (32 +\r
-                                                           (54 * (srShift < 2 ? 1 : 0)) +\r
-                                                           (104 * (srShift < 1 ? 1 : 0)) +\r
-                                                           (50 * (samplerate >= 44100 ? 1 : 0)));\r
+                        low = (channels + lfeCount) * (14 + (8 * (srShift < 2 ? 1 : 0)) + (6 * (srShift < 1 ? 1 : 0)));\r
+                        max = (channels + lfeCount) * (32 + (54 * (srShift < 2 ? 1 : 0)) + (104 * (srShift < 1 ? 1 : 0)) + (50 * (samplerate >= 44100 ? 1 : 0)));\r
                         break;\r
                     case AudioEncoder.Ac3:\r
                         low = 224 * channels / 5;\r
-                        max = samplerate > 24 ? 640 : 320;\r
+                        max = 640;\r
                         break;\r
                     case AudioEncoder.Ac3Passthrough:\r
                     case AudioEncoder.DtsPassthrough:\r
index 2f8d0d8e392eb42b029477a956002ef23ddf5f93..d90e5643f27e8506358c2a018030173443e0ceb7 100644 (file)
                                        VerticalAlignment="Center"\r
                                        FontWeight="Bold"\r
                                        Text="Bitrate"\r
-                                       Visibility="{Binding CanSetBitrate,\r
+                                       Visibility="{Binding CannotSetBitrate,\r
                                                             Converter={StaticResource boolToVisConverter},\r
                                                             ConverterParameter=true}" />\r
                             <ComboBox Grid.Column="5"\r
                                       ItemsSource="{Binding TrackReference,\r
                                                             Converter={StaticResource audioBitrateConverter}}"\r
                                       SelectedItem="{Binding Bitrate}"\r
-                                      Visibility="{Binding CanSetBitrate,\r
+                                      Visibility="{Binding CannotSetBitrate,\r
                                                            Converter={StaticResource boolToVisConverter},\r
                                                            ConverterParameter=true}" />\r
 \r