audio-resampler: fix samples_avail
We only know the taps after we calculate them.
This commit is contained in:
parent
c8fc9d88a7
commit
8dfb3ffb99
@ -889,15 +889,16 @@ gst_audio_resampler_new (GstAudioResamplerMethod method,
|
|||||||
resampler->bps = GST_AUDIO_FORMAT_INFO_WIDTH (info) / 8;
|
resampler->bps = GST_AUDIO_FORMAT_INFO_WIDTH (info) / 8;
|
||||||
resampler->bpf = resampler->bps * channels;
|
resampler->bpf = resampler->bps * channels;
|
||||||
resampler->sbuf = g_malloc0 (sizeof (gpointer) * channels);
|
resampler->sbuf = g_malloc0 (sizeof (gpointer) * channels);
|
||||||
/* half of the filter is filled with 0 */
|
|
||||||
resampler->samp_index = 0;
|
|
||||||
resampler->samples_avail = resampler->n_taps / 2;
|
|
||||||
|
|
||||||
GST_DEBUG ("method %d, bps %d, bpf %d", method, resampler->bps,
|
GST_DEBUG ("method %d, bps %d, bpf %d", method, resampler->bps,
|
||||||
resampler->bpf);
|
resampler->bpf);
|
||||||
|
|
||||||
gst_audio_resampler_update (resampler, in_rate, out_rate, options);
|
gst_audio_resampler_update (resampler, in_rate, out_rate, options);
|
||||||
|
|
||||||
|
/* half of the filter is filled with 0 */
|
||||||
|
resampler->samp_index = 0;
|
||||||
|
resampler->samples_avail = resampler->n_taps / 2;
|
||||||
|
|
||||||
return resampler;
|
return resampler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user