#include "hb.h"
#include "hbffmpeg.h"
-#include "audio_remap.h"
#include "audio_resample.h"
struct hb_work_private_s
hb_list_t * list;
uint8_t * buf;
- hb_audio_remap_t *remap;
hb_audio_resample_t *resample;
};
}
av_dict_free(&av_opts);
- // channel remapping
- pv->remap = hb_audio_remap_init(context->channel_layout, &hb_libav_chan_map,
- audio->config.in.channel_map);
- if (pv->remap == NULL)
- {
- hb_error("encavcodecaInit: hb_audio_remap_init() failed");
- }
-
// sample_fmt conversion
pv->resample = hb_audio_resample_init(context->sample_fmt,
audio->config.out.mixdown, 0, 0);
hb_list_empty(&pv->list);
}
- hb_audio_remap_free(pv->remap);
- pv->remap = NULL;
-
hb_audio_resample_free(pv->resample);
pv->resample = NULL;
hb_list_getbytes(pv->list, pv->buf, pv->input_samples * sizeof(float), &pts,
&pos);
- // channel remapping and sample_fmt conversion
- hb_audio_remap(pv->remap, (hb_sample_t*)pv->buf, pv->samples_per_frame);
+ // sample_fmt conversion
resampled = hb_audio_resample(pv->resample, (void*)pv->buf,
pv->samples_per_frame);