summaryrefslogtreecommitdiffstats
path: root/libhb/platform
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2012-07-11 20:10:20 +0000
committerjstebbins <[email protected]>2012-07-11 20:10:20 +0000
commit8b91bcb733913afea795cfea6178372eee5b4abe (patch)
tree09b4bd5693f2c361861d803522d2340b6beab985 /libhb/platform
parent7f1f338df87f6075e7edf0cd598523acaf0f82a1 (diff)
bump libav to libav-v0.8-2197-g1a068bf
Resolves several deprecated api's Eliminates several libav patches Eliminates our builtin downmix in favour of avresample Eliminate HB_INPUT_CH_LAYOUT_* and replace with AV_CH_LAYOUT_* Resolves 6.x and 7.0 input channel layout issues HB had Adds downmix support to declpcm. We never had it! git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4825 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/platform')
-rw-r--r--libhb/platform/macosx/encca_aac.c41
1 files changed, 20 insertions, 21 deletions
diff --git a/libhb/platform/macosx/encca_aac.c b/libhb/platform/macosx/encca_aac.c
index d67e039b2..7839ed930 100644
--- a/libhb/platform/macosx/encca_aac.c
+++ b/libhb/platform/macosx/encca_aac.c
@@ -8,7 +8,7 @@
*/
#include "hb.h"
-#include "downmix.h"
+#include "audio_remap.h"
#include <AudioToolbox/AudioToolbox.h>
#include <CoreAudio/CoreAudio.h>
@@ -49,8 +49,7 @@ struct hb_work_private_s
uint64_t pts, ibytes;
Float64 osamplerate;
- uint64_t layout;
- hb_chan_map_t *ichanmap;
+ int *remap_table;
};
#define MP4ESDescrTag 0x03
@@ -289,22 +288,17 @@ int encCoreAudioInit(hb_work_object_t *w, hb_job_t *job, enum AAC_MODE mode)
pv->osamplerate = output.mSampleRate;
audio->config.out.samples_per_frame = pv->isamples;
- // set channel map and layout (for remapping)
- pv->ichanmap = audio->config.in.channel_map;
- switch (audio->config.out.mixdown)
+ // channel remapping
+ if (pv->nchannels > 2 && audio->config.in.channel_map != &hb_aac_chan_map)
{
- case HB_AMIXDOWN_MONO:
- pv->layout = AV_CH_LAYOUT_MONO;
- break;
- case HB_AMIXDOWN_STEREO:
- case HB_AMIXDOWN_DOLBY:
- case HB_AMIXDOWN_DOLBYPLII:
- pv->layout = AV_CH_LAYOUT_STEREO;
- break;
- case HB_AMIXDOWN_6CH:
- default:
- pv->layout = AV_CH_LAYOUT_5POINT1;
- break;
+ uint64_t layout = hb_ff_mixdown_xlat(audio->config.out.mixdown, NULL);
+ pv->remap_table = hb_audio_remap_build_table(layout,
+ audio->config.in.channel_map,
+ &hb_aac_chan_map);
+ }
+ else
+ {
+ pv->remap_table = NULL;
}
// get maximum output size
@@ -350,6 +344,10 @@ void encCoreAudioClose(hb_work_object_t *w)
{
free(pv->buf);
}
+ if (pv->remap_table != NULL)
+ {
+ free(pv->remap_table);
+ }
hb_list_empty(&pv->list);
free(pv);
w->private_data = NULL;
@@ -394,10 +392,11 @@ static OSStatus inInputDataProc(AudioConverterRef converter, UInt32 *npackets,
*npackets = buffers->mBuffers[0].mDataByteSize / pv->isamplesiz;
pv->ibytes -= buffers->mBuffers[0].mDataByteSize;
- if (pv->ichanmap != &hb_qt_chan_map)
+ if (pv->remap_table != NULL)
{
- hb_layout_remap(pv->ichanmap, &hb_qt_chan_map, pv->layout,
- (float*)buffers->mBuffers[0].mData, *npackets);
+ hb_audio_remap(pv->nchannels, *npackets,
+ (hb_sample_t*)buffers->mBuffers[0].mData,
+ pv->remap_table);
}
return noErr;