qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 47/50] paaudio: channel-map option


From: Zoltán Kővágó
Subject: Re: [Qemu-devel] [PATCH v3 47/50] paaudio: channel-map option
Date: Wed, 23 Jan 2019 21:13:17 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 2019-01-17 11:03, Gerd Hoffmann wrote:
> On Thu, Jan 17, 2019 at 12:37:20AM +0100, Kővágó, Zoltán wrote:
>> Add an option to change the channel map used by pulseaudio.  If not
>> specified, falls back to an OSS compatible channel map.
>>
>> Signed-off-by: Kővágó, Zoltán <address@hidden>
>> ---
>>  qapi/audio.json |  5 ++++-
>>  audio/paaudio.c | 18 ++++++++++++++----
>>  qemu-options.hx |  9 +++++++++
>>  3 files changed, 27 insertions(+), 5 deletions(-)
>>
>> diff --git a/qapi/audio.json b/qapi/audio.json
>> index 7bcea6240f..86078039dc 100644
>> --- a/qapi/audio.json
>> +++ b/qapi/audio.json
>> @@ -107,11 +107,14 @@
>>  #
>>  # @name: name of the sink/source to use
>>  #
>> +# @channel-map: channel map to use (default: OSS compatible map)
>> +#
>>  # Since: 4.0
>>  ##
>>  { 'struct': 'AudiodevPaPerDirectionOptions',
>>    'data': {
>> -    '*name': 'str' } }
>> +    '*name':        'str',
>> +    '*channel-map': 'str' } }
> 
> Ah, I see.  Thats why patch #1 creates a AudiodevPaPerDirectionOptions
> struct with just one field ...

Yes, I was bitten by it too during a refactor, probably I should write a
few words about it in the commit message.

However, this is the exact reason I'd recommend nested structs instead
of randomly flattening it when we can.  This way, if we later have to
add an extra option, we don't end up in a problematic situation, since
we can't easily change things like 'dev-in' to a structure without
breaking backward compatibility.

Regards,
Zoltan



reply via email to

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