speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Reopen libao device handles when audio parameters change.


From: Christopher Brannon
Subject: [PATCH] Reopen libao device handles when audio parameters change.
Date: Wed, 01 Sep 2010 03:12:49 -0500

Andrei Kholodnyi <andrei.kholodnyi at gmail.com> writes:

>> +int current_bits = -1;

> static int?
> probably we even could use ao_sample_format instead?

I'll change this when I resend.

>> +static void libao_open_handle(int rate, int channels, int bits)
*SNIP*
>> +static void libao_close_handle(void)

> I'm wondering why do you need these 2 functions?
> they are called only once (ok, close called twice :D) and contain
> nothing but ao_open and ao_close?

Functions aren't just good for reuse.  IMHO, separating code into
smaller functions aids readability.  The compiler can inline, if
necessary.  In the case of these two definitions, it probably makes
sense to add the inline keyword.
Also, if we ever decide that we need to open the libao handle elsewhere
in the code, the function is already written and ready to reuse.

> You called your function libao_open_handle, but in really it does more
> then just open, it also keeps track on current format.

True.  I had a hard time coming up with a reasonable name, and I still can't
think of anything better.

-- Chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: 
<http://lists.freebsoft.org/pipermail/speechd/attachments/20100901/e0432e4a/attachment.pgp>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]