mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
audioresample: Try to prevent endless looping
Speex may decide not to consume any samples because it can't write any. I've
seen a hang during draining caused by the resample loop never terminating.
In that case, resampling happened as normal until olen was 0 but ilen was
still 1. _process_native then reduced ichunk to 0, so ilen never decreased
below 1 and the loop never terminated.
Instead of reverting 684cf44
({audioresample: don't skip input samples),
break only if all output samples have been produced and speex refuses
to consume any more input samples.
https://bugzilla.gnome.org/show_bug.cgi?id=732908
This commit is contained in:
parent
63afbce6be
commit
a636c39638
1 changed files with 4 additions and 0 deletions
|
@ -1200,6 +1200,8 @@ speex_resampler_process_float (SpeexResamplerState * st,
|
|||
out += ochunk * st->out_stride;
|
||||
if (in)
|
||||
in += ichunk * istride;
|
||||
if (olen == 0 && ichunk == 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
*in_len -= ilen;
|
||||
|
@ -1280,6 +1282,8 @@ speex_resampler_process_int (SpeexResamplerState * st,
|
|||
out += (ochunk + omagic) * ostride_save;
|
||||
if (in)
|
||||
in += ichunk * istride_save;
|
||||
if (olen == 0 && ichunk == 0)
|
||||
break;
|
||||
}
|
||||
st->out_stride = ostride_save;
|
||||
*in_len -= ilen;
|
||||
|
|
Loading…
Reference in a new issue