}
int64_t frame_length = int64_t(TIMEBASE) * video_format.frame_rate_den / video_format.frame_rate_nom;
+ assert(frame_length > 0);
size_t num_samples = (audio_frame.len > audio_offset) ? (audio_frame.len - audio_offset) / audio_format.num_channels / (audio_format.bits_per_sample / 8) : 0;
if (num_samples > OUTPUT_FREQUENCY / 10) {
bool ResamplingQueue::get_output_samples(double pts, float *samples, ssize_t num_samples)
{
+ assert(num_samples > 0);
if (first_input) {
// No data yet, just return zeros.
memset(samples, 0, num_samples * 2 * sizeof(float));