• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

githubのコードからのfolk


Commit MetaInfo

Revisiona24beee4f3694f797ea967869dbd94a215fc770d (tree)
Time2010-10-29 23:35:00
Authordynaflash <dynaflash@b64f...>
Commiterdynaflash

Log Message

MacGui: Audio - Using fallback codec no longer sets the bit rate from the preset. Setting the sample rate no longer sets the bit rate to the default if the currently selected bit rate is still supported.

git-svn-id: svn://localhost/HandBrake/trunk@3627 b64f7644-9d1e-0410-96f1-a4d463321fa5

Change Summary

Incremental Difference

--- a/macosx/HBAudio.m
+++ b/macosx/HBAudio.m
@@ -325,7 +325,7 @@ static NSMutableArray *masterBitRateArray = nil;
325325 return;
326326 }
327327
328-- (void) updateBitRates
328+- (void) updateBitRates: (BOOL) shouldSetDefault
329329
330330 {
331331 NSMutableArray *permittedBitRates = [NSMutableArray array];
@@ -391,7 +391,9 @@ static NSMutableArray *masterBitRateArray = nil;
391391 [self setBitRates: permittedBitRates];
392392
393393 // Select the proper one
394- [self setBitRateFromName: defaultBitRate];
394+ if (YES == shouldSetDefault) {
395+ [self setBitRateFromName: defaultBitRate];
396+ }
395397
396398 if (nil == [self bitRate] || NO == [permittedBitRates containsObject: [self bitRate]]) {
397399 [self setBitRate: [permittedBitRates lastObject]];
@@ -464,7 +466,7 @@ static NSMutableArray *masterBitRateArray = nil;
464466 [codec release];
465467 codec = aValue;
466468 [self updateMixdowns];
467- [self updateBitRates];
469+ [self updateBitRates: YES];
468470 }
469471 return;
470472 }
@@ -476,12 +478,24 @@ static NSMutableArray *masterBitRateArray = nil;
476478 [aValue retain];
477479 [mixdown release];
478480 mixdown = aValue;
479- [self updateBitRates];
481+ [self updateBitRates: YES];
480482 [[NSNotificationCenter defaultCenter] postNotificationName: HBMixdownChangedNotification object: self];
481483 }
482484 return;
483485 }
484486
487+- (void) setSampleRate: (NSDictionary *) aValue
488+
489+{
490+ if ((nil != aValue || nil != sampleRate) && NO == [aValue isEqual: sampleRate]) {
491+ [aValue retain];
492+ [sampleRate release];
493+ sampleRate = aValue;
494+ [self updateBitRates: NO];
495+ }
496+ return;
497+}
498+
485499 - (NSArray *) tracks { return [controller masterTrackArray]; }
486500
487501 - (NSArray *) sampleRates { return masterSampleRateArray; }
--- a/macosx/HBAudioController.m
+++ b/macosx/HBAudioController.m
@@ -241,6 +241,7 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
241241
242242 while (nil != (dict = [enumerator nextObject])) {
243243 if ([self countOfAudioArray] < maximumNumberOfAllowedAudioTracks) {
244+ BOOL fallenBack = NO;
244245 HBAudio *newAudio = [[HBAudio alloc] init];
245246 [newAudio setController: self];
246247 [self insertObject: newAudio inAudioArrayAtIndex: [self countOfAudioArray]];
@@ -257,6 +258,7 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
257258 YES == [key isEqualToString: @"AC3 Passthru"]) {
258259 if (NO == [newAudio setCodecFromName: key]) {
259260 key = @"AC3";
261+ fallenBack = YES;
260262 }
261263 }
262264 // If our preset wants us to support a codec that the track does not support, instead
@@ -264,7 +266,9 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
264266 if (YES == [newAudio setCodecFromName: key]) {
265267 [newAudio setMixdownFromName: [dict objectForKey: @"AudioMixdown"]];
266268 [newAudio setSampleRateFromName: [dict objectForKey: @"AudioSamplerate"]];
267- [newAudio setBitRateFromName: [dict objectForKey: @"AudioBitrate"]];
269+ if (NO == fallenBack) {
270+ [newAudio setBitRateFromName: [dict objectForKey: @"AudioBitrate"]];
271+ }
268272 [newAudio setDrc: [dict objectForKey: @"AudioTrackDRCSlider"]];
269273 }
270274 else {