ringbuffer: handle border cases in resampler

This commit is contained in:
Wim Taymans 2009-06-11 19:12:51 +02:00
parent b2930f24b0
commit a9c82f9472

View file

@ -1503,7 +1503,7 @@ G_STMT_START { \
memcpy (d, se, bps); \ memcpy (d, se, bps); \
se -= bps; \ se -= bps; \
*accum += outr; \ *accum += outr; \
while ((*accum << 1) >= inr) { \ while (d < de && (*accum << 1) >= inr) { \
*accum -= inr; \ *accum -= inr; \
d += bps; \ d += bps; \
} \ } \
@ -1521,7 +1521,7 @@ G_STMT_START { \
memcpy (d, se, bps); \ memcpy (d, se, bps); \
d += bps; \ d += bps; \
*accum += inr; \ *accum += inr; \
while ((*accum << 1) >= outr) { \ while (s <= se && (*accum << 1) >= outr) { \
*accum -= outr; \ *accum -= outr; \
se -= bps; \ se -= bps; \
} \ } \