diff options
author | Rodeo <[email protected]> | 2012-06-20 15:59:03 +0000 |
---|---|---|
committer | Rodeo <[email protected]> | 2012-06-20 15:59:03 +0000 |
commit | 28ff9e210e2604c47c5f157043aa85d4d56b6a16 (patch) | |
tree | 40c56e52a934f567e38a4ee15fbf6bcdb9fae070 | |
parent | d2189f51f3d68ac81e4849bda4a96877981baeab (diff) |
Remove encca_haac_available(). It's no longer needed since we dropped support for OS X 10.5.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4759 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | libhb/hb.c | 53 | ||||
-rw-r--r-- | libhb/hb.h | 8 | ||||
-rw-r--r-- | libhb/work.c | 61 | ||||
-rw-r--r-- | macosx/HBAudio.m | 20 |
4 files changed, 35 insertions, 107 deletions
diff --git a/libhb/hb.c b/libhb/hb.c index 0d881b888..2a1cf53c4 100644 --- a/libhb/hb.c +++ b/libhb/hb.c @@ -2023,56 +2023,3 @@ hb_interjob_t * hb_interjob_get( hb_handle_t * h ) { return h->interjob; } - -/************************************************************************ - * encca_haac_available() - ************************************************************************ - * Returns whether the Core Audio HE-AAC encoder is available for use - * on the system. Under 10.5, if the encoder is available, register it. - * The registration is actually only performed on the first call. - ************************************************************************/ -int encca_haac_available() -{ -#ifdef __APPLE__ - static int encca_haac_available = -1; - - if (encca_haac_available != -1) - return encca_haac_available; - - encca_haac_available = 0; - - long minorVersion, majorVersion, quickTimeVersion; - Gestalt(gestaltSystemVersionMajor, &majorVersion); - Gestalt(gestaltSystemVersionMinor, &minorVersion); - Gestalt(gestaltQuickTime, &quickTimeVersion); - - if (majorVersion > 10 || (majorVersion == 10 && minorVersion >= 6)) - { - // OS X 10.6+ - ca_haac is available and ready to use - encca_haac_available = 1; - } - else if (majorVersion == 10 && minorVersion >= 5 && quickTimeVersion >= 0x07630000) - { - // OS X 10.5, QuickTime 7.6.3+ - register the component - ComponentDescription cd; - cd.componentType = kAudioEncoderComponentType; - cd.componentSubType = kAudioFormatMPEG4AAC_HE; - cd.componentManufacturer = kAudioUnitManufacturer_Apple; - cd.componentFlags = 0; - cd.componentFlagsMask = 0; - ComponentResult (*ComponentRoutine) (ComponentParameters * cp, Handle componentStorage); - void *handle = dlopen("/System/Library/Components/AudioCodecs.component/Contents/MacOS/AudioCodecs", RTLD_LAZY|RTLD_LOCAL); - if (handle) - { - ComponentRoutine = dlsym(handle, "ACMP4AACHighEfficiencyEncoderEntry"); - if (ComponentRoutine) - if (RegisterComponent(&cd, ComponentRoutine, 0, NULL, NULL, NULL)) - encca_haac_available = 1; - } - } - - return encca_haac_available; -#else - return 0; -#endif -} diff --git a/libhb/hb.h b/libhb/hb.h index f3c73c26d..9f65dca93 100644 --- a/libhb/hb.h +++ b/libhb/hb.h @@ -17,14 +17,6 @@ extern "C" { #include "project.h" #include "common.h" -#ifdef __APPLE__ -#include <CoreServices/CoreServices.h> // for Gestalt -#include <AudioToolbox/AudioToolbox.h> -#include <dlfcn.h> -#endif -/* Whether the Core Audio HE-AAC encoder is available on the system. */ -int encca_haac_available(); - /* hb_init() Initializes a libhb session (launches his own thread, detects CPUs, etc) */ diff --git a/libhb/work.c b/libhb/work.c index c8e7822b8..62d63ee3b 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -751,61 +751,52 @@ static void do_job( hb_job_t * job ) /* * Audio fifos must be initialized before sync */ - if( !job->indepth_scan ) + if (!job->indepth_scan) { // apply Auto Passthru settings - hb_autopassthru_apply_settings( job, title ); + hb_autopassthru_apply_settings(job, title); // sanitize audio settings - for( i = 0; i < hb_list_count( title->list_audio ); ) + for (i = 0; i < hb_list_count(title->list_audio);) { - audio = hb_list_item( title->list_audio, i ); - if( audio->config.out.codec == HB_ACODEC_AUTO_PASS ) + audio = hb_list_item(title->list_audio, i); + if (audio->config.out.codec == HB_ACODEC_AUTO_PASS) { // Auto Passthru should have been handled above // remove track to avoid a crash - hb_log( "Auto Passthru error, dropping track %d", - audio->config.out.track ); - hb_list_rem( title->list_audio, audio ); - free( audio ); + hb_log("Auto Passthru error, dropping track %d", + audio->config.out.track); + hb_list_rem(title->list_audio, audio); + free(audio); continue; } - if( ( audio->config.out.codec & HB_ACODEC_PASS_FLAG ) && - !( audio->config.in.codec & audio->config.out.codec & HB_ACODEC_PASS_MASK ) ) + if ((audio->config.out.codec & HB_ACODEC_PASS_FLAG) && + !(audio->config.in.codec & audio->config.out.codec & HB_ACODEC_PASS_MASK)) { - hb_log( "Passthru requested and input codec is not the same as output codec for track %d, dropping track", - audio->config.out.track ); - hb_list_rem( title->list_audio, audio ); - free( audio ); + hb_log("Passthru requested and input codec is not the same as output codec for track %d, dropping track", + audio->config.out.track); + hb_list_rem(title->list_audio, audio); + free(audio); continue; } - if( !(audio->config.out.codec & HB_ACODEC_PASS_FLAG) ) + if (!(audio->config.out.codec & HB_ACODEC_PASS_FLAG)) { - if( audio->config.out.samplerate > 48000 ) - { - hb_log( "Sample rate %d not supported. Down-sampling to 48kHz.", - audio->config.out.samplerate ); - audio->config.out.samplerate = 48000; - } - // if not specified, set to same as input - if( audio->config.out.samplerate < 0 ) + if (audio->config.out.samplerate < 0) { + // if not specified, set to same as input audio->config.out.samplerate = audio->config.in.samplerate; } - } - if( audio->config.out.codec == HB_ACODEC_CA_HAAC ) - { - if( !encca_haac_available() ) + if (audio->config.out.samplerate > 48000) { - // user chose Core Audio HE-AAC but the encoder is unavailable - hb_log( "Core Audio HE-AAC unavailable. Using Core Audio AAC for track %d", - audio->config.out.track ); - audio->config.out.codec = HB_ACODEC_CA_AAC; + hb_log("Sample rate %d not supported. Downsampling to 48kHz for track %d", + audio->config.out.samplerate, audio->config.out.track); + audio->config.out.samplerate = 48000; } - else if( audio->config.out.samplerate < 32000 ) + else if (audio->config.out.samplerate < 32000 && + audio->config.out.codec == HB_ACODEC_CA_HAAC) { // Core Audio HE-AAC doesn't support samplerates < 32 kHz - hb_log( "Sample rate %d not supported (ca_haac). Using 32kHz for track %d", - audio->config.out.samplerate, audio->config.out.track ); + hb_log("Sample rate %d not supported (ca_haac). Using 32kHz for track %d", + audio->config.out.samplerate, audio->config.out.track); audio->config.out.samplerate = 32000; } } diff --git a/macosx/HBAudio.m b/macosx/HBAudio.m index 51743dcfa..b170e4a50 100644 --- a/macosx/HBAudio.m +++ b/macosx/HBAudio.m @@ -70,28 +70,26 @@ static NSMutableArray *masterBitRateArray = nil; { if ([HBAudio class] == self) { - int i, audioMustMatch, shouldAdd; + int i, audioMustMatch; BOOL muxMKV, muxMP4; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSDictionary *dict; masterCodecArray = [[NSMutableArray alloc] init]; // knowingly leaked - for( i = 0; i < hb_audio_encoders_count; i++ ) + for (i = 0; i < hb_audio_encoders_count; i++) { - if( ( hb_audio_encoders[i].encoder & HB_ACODEC_PASS_FLAG ) && - ( hb_audio_encoders[i].encoder != HB_ACODEC_AUTO_PASS ) ) + if ((hb_audio_encoders[i].encoder & HB_ACODEC_PASS_FLAG) && + (hb_audio_encoders[i].encoder != HB_ACODEC_AUTO_PASS)) { - audioMustMatch = ( hb_audio_encoders[i].encoder & ~HB_ACODEC_PASS_FLAG ); + audioMustMatch = (hb_audio_encoders[i].encoder & ~HB_ACODEC_PASS_FLAG); } else { audioMustMatch = 0; } - // don't add HE-AAC encoder if it's unavailable - shouldAdd = ( hb_audio_encoders[i].encoder != HB_ACODEC_CA_HAAC ) || encca_haac_available(); - muxMKV = ( hb_audio_encoders[i].muxers & HB_MUX_MKV ) ? YES : NO; - muxMP4 = ( hb_audio_encoders[i].muxers & HB_MUX_MP4 ) ? YES : NO; - if( shouldAdd && audioMustMatch ) + muxMKV = (hb_audio_encoders[i].muxers & HB_MUX_MKV) ? YES : NO; + muxMP4 = (hb_audio_encoders[i].muxers & HB_MUX_MP4) ? YES : NO; + if (audioMustMatch) { [masterCodecArray addObject: [NSDictionary dictionaryWithObjectsAndKeys: [NSString stringWithUTF8String: hb_audio_encoders[i].human_readable_name], keyAudioCodecName, @@ -101,7 +99,7 @@ static NSMutableArray *masterBitRateArray = nil; [NSNumber numberWithInt: audioMustMatch], keyAudioMustMatchTrack, nil]]; } - else if( shouldAdd ) + else { [masterCodecArray addObject: [NSDictionary dictionaryWithObjectsAndKeys: [NSString stringWithUTF8String: hb_audio_encoders[i].human_readable_name], keyAudioCodecName, |