On Wed, Oct 29, 2008 at 02:31:03AM +0900, IWATA Ray wrote:
> Hi,
> 
> This patch adds plugin for libsndio.
> If you want to test this backend, please add your ~/.libao.
> 
> $ echo default_driver=sndio > ~/.libao
> 

thanks, its unfortunate we've done the job twice, there's already a
libao update in the pipe.

Anyway I've few comments. As jakemsr pointed, avoid modifying too
much generated files.

I put few comments about the backend itself, in case you port/write
other audio stuff.

> ++
> ++typedef struct ao_sndio_internal {
> ++    struct sio_hdl *hdl;
> ++} ao_sndio_internal;
> ++

that doesn't hurt, but there's no need to define a new structure,
since you can use the ``hdl'' pointer instead.

> ++int
> ++ao_plugin_test()
> ++{
> ++    struct sio_hdl *hdl;
> ++
> ++    if ((hdl = sio_open(NULL, SIO_PLAY, 0)) != NULL)
> ++            return 0;

you should call sio_close() here, because this will leak a handle.

[...]

> ++
> ++int
> ++ao_plugin_open(ao_device *device, ao_sample_format *format)
> ++{
> ++    ao_sndio_internal *internal = (ao_sndio_internal *)device->internal;
> ++    struct sio_par par;
> ++
> ++    if ((internal->hdl = sio_open(NULL, SIO_PLAY, 0)) == NULL)
> ++            return 0;
> ++
> ++    if (sio_initpar(&par) == 0)
> ++            return 0;
> ++

sio_initpar() returns void. There was a mistake in the
header, it's fixed now.

-- Alexandre

Reply via email to