upload of (youtube) fails and of normal from windows
-sort out audio channel count mess, assert what we get is what we expect early on.
Write still j2ks straight to a MXF.
Seem to be problems when waiting for (failing) server threads at the end of an encode;
/** Called by subclasses to tell the world that some audio data is ready */
void
-Decoder::process_audio (uint8_t* data, int channels, int size)
+Decoder::process_audio (uint8_t* data, int size)
{
int const samples = size / _fs->bytes_per_sample();
- int const frames = samples / channels;
+ int const frames = samples / _fs->audio_channels;
if (_fs->audio_gain != 0) {
float const linear_gain = pow (10, _fs->audio_gain / 20);
};
int const out_buffer_size_frames = ceil (frames * float (dcp_audio_sample_rate (_fs->audio_sample_rate)) / _fs->audio_sample_rate) + 32;
- int const out_buffer_size_bytes = out_buffer_size_frames * channels * _fs->bytes_per_sample();
+ int const out_buffer_size_bytes = out_buffer_size_frames * _fs->audio_channels * _fs->bytes_per_sample();
out_buffer = new uint8_t[out_buffer_size_bytes];
uint8_t* out[2] = {
}
data = out_buffer;
- size = out_frames * channels * _fs->bytes_per_sample();
+ size = out_frames * _fs->audio_channels * _fs->bytes_per_sample();
}
/* Update the number of audio frames we've pushed to the encoder */
- _audio_frames_processed += size / (channels * _fs->bytes_per_sample ());
+ _audio_frames_processed += size / (_fs->audio_channels * _fs->bytes_per_sample ());
int available = _delay_line->feed (data, size);
Audio (data, available);
virtual int sample_aspect_ratio_denominator () const = 0;
void process_video (AVFrame *);
- void process_audio (uint8_t *, int, int);
+ void process_audio (uint8_t *, int);
/** our FilmState */
boost::shared_ptr<const FilmState> _fs;
0, _audio_codec_context->channels, _frame->nb_samples, audio_sample_format (), 1
);
- process_audio (_frame->data[0], _audio_codec_context->channels, data_size);
+ assert (_audio_codec_context->channels == _fs->audio_channels);
+ process_audio (_frame->data[0], data_size);
}
}