{
gpointer *res;
- while (!chain->samples)
+ if (!chain->samples)
chain->make_func (chain, chain->make_func_data);
res = chain->samples;
out = (chain->allow_ip ? in : audio_chain_alloc_samples (chain, num_samples));
GST_LOG ("quantize %p, %p %" G_GSIZE_FORMAT, in, out, num_samples);
- gst_audio_quantize_samples (convert->quant, in, out, num_samples);
+ if (in && out)
+ gst_audio_quantize_samples (convert->quant, in, out, num_samples);
audio_chain_set_samples (chain, out, num_samples);
/* get frames to pack */
tmp = audio_chain_get_samples (chain, &produced);
- if (!convert->out_default) {
+ if (!convert->out_default && tmp && out) {
GST_LOG ("pack %p, %p %" G_GSIZE_FORMAT, tmp, out, produced);
/* and pack if needed */
for (i = 0; i < chain->blocks; i++)
need = resampler->n_taps + resampler->samp_index;
if (G_UNLIKELY (samples_avail < need || out_frames == 0)) {
GST_LOG ("not enough samples to start: need %" G_GSIZE_FORMAT ", avail %"
- G_GSIZE_FORMAT ", out %" G_GSIZE_FORMAT, samples_avail, need,
+ G_GSIZE_FORMAT ", out %" G_GSIZE_FORMAT, need, samples_avail,
out_frames);
/* not enough samples to start */
return;