1
0
mirror of https://github.com/ericonr/sndio.git synced 2024-02-18 04:45:21 -06:00

free() slot conversion & resampling buffers

This commit is contained in:
Alexandre Ratchov 2012-10-29 14:18:48 +01:00
parent b7818cbbce
commit d2102db943

View File

@ -1888,8 +1888,13 @@ slot_stop(struct slot *s)
} else } else
s->pstate = SLOT_INIT; s->pstate = SLOT_INIT;
} }
if (s->mode & MODE_RECMASK) if (s->mode & MODE_RECMASK) {
abuf_done(&s->sub.buf); abuf_done(&s->sub.buf);
if (s->sub.encbuf)
xfree(s->sub.encbuf);
if (s->sub.resampbuf)
xfree(s->sub.resampbuf);
}
if (s->pstate == SLOT_READY) { if (s->pstate == SLOT_READY) {
#ifdef DEBUG #ifdef DEBUG
if (log_level >= 3) { if (log_level >= 3) {
@ -1897,8 +1902,13 @@ slot_stop(struct slot *s)
log_puts(": not drained (blocked by mmc)\n"); log_puts(": not drained (blocked by mmc)\n");
} }
#endif #endif
if (s->mode & MODE_PLAY) if (s->mode & MODE_PLAY) {
abuf_done(&s->mix.buf); abuf_done(&s->mix.buf);
if (s->mix.decbuf)
xfree(s->mix.decbuf);
if (s->mix.resampbuf)
xfree(s->mix.resampbuf);
}
s->ops->eof(s->arg); s->ops->eof(s->arg);
s->pstate = SLOT_INIT; s->pstate = SLOT_INIT;
} else { } else {