OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / macosx / Controller.mm
index 7a26b88..4c6f50c 100644 (file)
@@ -2090,6 +2090,7 @@ static NSString *        ChooseSourceIdentifier             = @"Choose Source It
 - (IBAction) formatPopUpChanged: (id) sender
 {
     NSString * string = [fDstFile2Field stringValue];
+    NSString * selectedCodecs = [fDstCodecsPopUp titleOfSelectedItem];
     int format = [fDstFormatPopUp indexOfSelectedItem];
     char * ext = NULL;
        /* Initially set the large file (64 bit formatting) output checkbox to hidden */
@@ -2176,6 +2177,11 @@ static NSString *        ChooseSourceIdentifier             = @"Choose Source It
                        [fCreateChapterMarkers setEnabled: YES];
                        break;
     }
+    if ( SuccessfulScan ) {
+        [fDstCodecsPopUp selectItemWithTitle:selectedCodecs];
+        if ( [fDstCodecsPopUp selectedItem] == NULL )
+            [fDstCodecsPopUp selectItemAtIndex:0];
+        }
     [self codecsPopUpChanged: NULL];
 
     /* Add/replace to the correct extension */
@@ -2466,7 +2472,8 @@ static NSString *        ChooseSourceIdentifier             = @"Choose Source It
             int audioCodecsSupportMono = ((audio->codec == HB_ACODEC_AC3 ||
                 audio->codec == HB_ACODEC_DCA) && acodec == HB_ACODEC_FAAC);
             int audioCodecsSupport6Ch =  ((audio->codec == HB_ACODEC_AC3 ||
-                audio->codec == HB_ACODEC_DCA) && acodec == HB_ACODEC_FAAC);
+                audio->codec == HB_ACODEC_DCA) && (acodec == HB_ACODEC_FAAC ||
+                acodec == HB_ACODEC_VORBIS));
 
             /* check for AC-3 passthru */
             if (audio->codec == HB_ACODEC_AC3 && acodec == HB_ACODEC_AC3)
@@ -2620,11 +2627,22 @@ static NSString *        ChooseSourceIdentifier             = @"Choose Source It
             break;
 
         case HB_ACODEC_VORBIS:
+        if ([[fAudTrack1MixPopUp selectedItem] tag] == HB_AMIXDOWN_6CH || [[fAudTrack2MixPopUp selectedItem] tag] == HB_AMIXDOWN_6CH)
+            {
+                /* Vorbis causes a crash if we use a bitrate below 192 kbps with 6 channel */
+                minbitrate = 192;
+                /* If either mixdown popup includes 6-channel discrete, then allow up to 384 kbps */
+                maxbitrate = 384;
+                break;
+            }
+            else
+            {
             /* Vorbis causes a crash if we use a bitrate below 48 kbps */
             minbitrate = 48;
             /* Vorbis can cope with 384 kbps quite happily, even for stereo */
             maxbitrate = 384;
             break;
+            }
 
         default:
             /* AC3 passthru disables the bitrate dropdown anyway, so we might as well just use the min and max bitrate */