free() slot conversion & resampling buffers

This commit is contained in:
Alexandre Ratchov 2012-10-29 14:18:48 +01:00
parent b7818cbbce
commit d2102db943
1 changed files with 12 additions and 2 deletions

View File

@ -1888,8 +1888,13 @@ slot_stop(struct slot *s)
} else
s->pstate = SLOT_INIT;
}
if (s->mode & MODE_RECMASK)
if (s->mode & MODE_RECMASK) {
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) {
#ifdef DEBUG
if (log_level >= 3) {
@ -1897,8 +1902,13 @@ slot_stop(struct slot *s)
log_puts(": not drained (blocked by mmc)\n");
}
#endif
if (s->mode & MODE_PLAY)
if (s->mode & MODE_PLAY) {
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->pstate = SLOT_INIT;
} else {