mirror of
http://mpg123.de/trunk/.git
synced 2025-10-25 04:37:34 +03:00
Finished hacking in loadable output module support from branch "njh-outputplugin".
Legacy support allows statically compiling in a single module. Still needs some work, but a quick test on my MacBook worked :) git-svn-id: svn://scm.orgis.org/mpg123/trunk@932 35dc7657-300d-0410-a2e5-dc2837fedb53
This commit is contained in:
20
src/buffer.c
20
src/buffer.c
@@ -92,7 +92,7 @@ void buffer_sig(int signal, int block)
|
||||
return;
|
||||
}
|
||||
|
||||
void buffer_loop(struct audio_info_struct *ai, sigset_t *oldsigset)
|
||||
void buffer_loop(audio_output_t *ao, sigset_t *oldsigset)
|
||||
{
|
||||
int bytes;
|
||||
int my_fd = buffermem->fd[XF_READER];
|
||||
@@ -104,7 +104,7 @@ void buffer_loop(struct audio_info_struct *ai, sigset_t *oldsigset)
|
||||
catchsignal (SIGUSR1, catch_usr1);
|
||||
sigprocmask (SIG_SETMASK, oldsigset, NULL);
|
||||
if (param.outmode == DECODE_AUDIO) {
|
||||
if (audio_open(ai) < 0) {
|
||||
if (ao->open(ao) < 0) {
|
||||
perror("audio");
|
||||
exit(1);
|
||||
}
|
||||
@@ -119,7 +119,7 @@ void buffer_loop(struct audio_info_struct *ai, sigset_t *oldsigset)
|
||||
if (intflag) {
|
||||
intflag = FALSE;
|
||||
if (param.outmode == DECODE_AUDIO)
|
||||
audio_queueflush (ai);
|
||||
ao->flush(ao);
|
||||
xf->readindex = xf->freeindex;
|
||||
if (xf->wakeme[XF_WRITER])
|
||||
xfermem_putcmd(my_fd, XF_CMD_WAKEUP);
|
||||
@@ -141,11 +141,11 @@ void buffer_loop(struct audio_info_struct *ai, sigset_t *oldsigset)
|
||||
if (xf->wakeme[XF_WRITER])
|
||||
xfermem_putcmd(my_fd, XF_CMD_WAKEUP);
|
||||
if (param.outmode == DECODE_AUDIO) {
|
||||
audio_close (ai);
|
||||
ai->rate = xf->buf[0];
|
||||
ai->channels = xf->buf[1];
|
||||
ai->format = xf->buf[2];
|
||||
if (audio_open(ai) < 0) {
|
||||
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);
|
||||
}
|
||||
@@ -218,7 +218,7 @@ void buffer_loop(struct audio_info_struct *ai, sigset_t *oldsigset)
|
||||
if (param.outmode == DECODE_FILE)
|
||||
bytes = write(OutputDescriptor, xf->data + xf->readindex, bytes);
|
||||
else if (param.outmode == DECODE_AUDIO)
|
||||
bytes = audio_play_samples(ai,
|
||||
bytes = ao->write(ao,
|
||||
(unsigned char *) (xf->data + xf->readindex), bytes);
|
||||
|
||||
if(bytes < 0) {
|
||||
@@ -246,7 +246,7 @@ void buffer_loop(struct audio_info_struct *ai, sigset_t *oldsigset)
|
||||
}
|
||||
|
||||
if (param.outmode == DECODE_AUDIO)
|
||||
audio_close (ai);
|
||||
ao->close(ao);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user