On Sat, Dec 27, 2008 at 01:49:51PM +0900, IWATA Ray wrote:
> Hi,
> 
> This patch adds libsndio to audio/timidity.
> libsndio is assigned sound output option to '-Os' and set default
> output.
> 
> Thanks.

thank you :)

> diff -aruN timidity/files/sndio_a.c timidity-libsndio/files/sndio_a.c
> --- timidity/files/sndio_a.c  Thu Jan  1 09:00:00 1970
> +++ timidity-libsndio/files/sndio_a.c Sat Dec 27 11:20:40 2008
> @@ -0,0 +1,124 @@
> +/*
> +    TiMidity++ -- MIDI to WAVE converter and player
> +    Copyright (C) 1999-2002 Masanao Izumo <m...@goice.co.jp>
> +    Copyright (C) 1995 Tuukka Toivonen <t...@cgs.fi>

> +    sndio_a.c
> +     Written by Iwata <ira...@gmail.com>

upstream may require that license for inclusion, but as long as it's
distributed in the ports tree, it's best to use ISC license and assert
your own copyright.

> +  sndio_ctx = sio_open(NULL, SIO_PLAY, 0);
> +  if (sndio_ctx == NULL) {
> +    ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s",
> +           dpm.name, strerror(errno));
> +    return -1;
> +  }

you can't really rely on sio_* to set errno.

> +static int acntl(int request, void *arg)
> +{
> +  switch(request) {
> +  case PM_REQ_DISCARD:
> +  case PM_REQ_PLAY_START: /* Called just before playing */
> +  case PM_REQ_PLAY_END: /* Called just after playing */
> +    return 0;
> +  }

might it be better to use sio_start/sio_stop here?  I don't know,
just thinking aloud.

it's also good style to use sio_getpar and check that the parameters
that were asked for are the parameters that got set.

the rest looks good.

-- 
jake...@sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org

Reply via email to