From: Hao Peng <peng.h...@zte.com.cn> if audio device is opend for a long time in windows vm, there is a uint32_t varaible reversal. It will result to a dead loop.
Signed-off-by: Peng Hao <peng.h...@zte.com.cn> Reviewed-by: Liu Yun <liu.y...@zte.com.cn> Reviewed-by: Wang Yechao <wang.yechao...@zte.com.cn> --- audio/rate_template.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/audio/rate_template.h b/audio/rate_template.h index bd4b1c7..1aa6c43 100644 --- a/audio/rate_template.h +++ b/audio/rate_template.h @@ -71,6 +71,11 @@ void NAME (void *opaque, struct st_sample *ibuf, struct st_sample *obuf, while (rate->ipos <= (rate->opos >> 32)) { ilast = *ibuf++; rate->ipos++; + /* if ipos reversal, there is a dead loop */ + if (rate->ipos == 0xffffffff) { + rate->ipos = 1; + rate->opos = rate->opos & 0xffffffff; + } /* See if we finished the input buffer yet */ if (ibuf >= iend) { goto the_end; -- 1.8.3.1