1
0
mirror of http://mpg123.de/trunk/.git synced 2025-10-25 04:37:34 +03:00

Fix an alsa (not just there, I guess) crash by making sure the ao->userptr and ao->fn get cleared after close in close_output.

Also removed direct uses of ao->close in mpg123.c and buffer.c .


git-svn-id: svn://scm.orgis.org/mpg123/trunk@1044 35dc7657-300d-0410-a2e5-dc2837fedb53
This commit is contained in:
thor
2007-10-24 16:13:46 +00:00
parent 168e6dddea
commit 72da73dbf3
6 changed files with 42 additions and 25 deletions

View File

@@ -141,15 +141,12 @@ void buffer_loop(audio_output_t *ao, sigset_t *oldsigset)
*/
if (xf->wakeme[XF_WRITER])
xfermem_putcmd(my_fd, XF_CMD_WAKEUP);
if (param.outmode == DECODE_AUDIO) {
ao->close(ao);
ao->rate = xf->buf[0];
ao->channels = xf->buf[1];
ao->format = xf->buf[2];
if (ao->open(ao) < 0) {
perror("audio");
exit(1);
}
ao->rate = xf->buf[0];
ao->channels = xf->buf[1];
ao->format = xf->buf[2];
if (reset_output(ao) < 0) {
error1("failed to reset audio: %s", strerror(errno));
exit(1);
}
}
if ( (bytes = xfermem_get_usedspace(xf)) < outburst ) {