| 160 | } |
| 161 | |
| 162 | static int declpcmInit( hb_work_object_t * w, hb_job_t * job ) |
| 163 | { |
| 164 | hb_work_private_t * pv = calloc( 1, sizeof( hb_work_private_t ) ); |
| 165 | if (pv == NULL) |
| 166 | { |
| 167 | hb_error("declpcmInit: hb_audio_resample_init() failed"); |
| 168 | return 1; |
| 169 | } |
| 170 | w->private_data = pv; |
| 171 | pv->job = job; |
| 172 | |
| 173 | pv->next_pts = (int64_t)AV_NOPTS_VALUE; |
| 174 | // Currently, samplerate conversion is performed in sync.c |
| 175 | // So set output samplerate to input samplerate |
| 176 | // This should someday get reworked to be part of an audio filter pipeline. |
| 177 | pv->resample = |
| 178 | hb_audio_resample_init(AV_SAMPLE_FMT_FLT, |
| 179 | w->audio->config.in.samplerate, |
| 180 | w->audio->config.out.mixdown, |
| 181 | w->audio->config.out.normalize_mix_level); |
| 182 | if (pv->resample == NULL) |
| 183 | { |
| 184 | hb_error("declpcmInit: hb_audio_resample_init() failed"); |
| 185 | return 1; |
| 186 | } |
| 187 | |
| 188 | return 0; |
| 189 | } |
| 190 | |
| 191 | /* |
| 192 | * Convert DVD encapsulated LPCM to floating point PCM audio buffers. |
nothing calls this directly
no test coverage detected