[PATCH] ALSA: pcm: Unify snd_pcm_delay() and snd_pcm_hwsync()

Pierre-Louis Bossart pierre-louis.bossart at linux.intel.com
Thu Oct 14 18:19:06 CEST 2021



On 10/14/21 11:08 AM, Takashi Iwai wrote:
> On Thu, 14 Oct 2021 17:59:21 +0200,
> Pierre-Louis Bossart wrote:
>>
>>
>>
>> On 10/14/21 9:53 AM, Takashi Iwai wrote:
>>> Both snd_pcm_delay() and snd_pcm_hwsync() do the almost same thing.
>>> The only difference is that the former calculate the delay, so unify
>>> them as a code cleanup, and treat NULL delay argument only for hwsync
>>> operation.
>>>
>>> Also, the patch does a slight code refactoring in snd_pcm_delay().
>>> The initialization of the delay value is done in the caller side now.
>>
>> I would have done the opposite change, i.e. keep snd_pcm_hwsync() but
>> add an optional delay argument/calculation.
>>
>> 'snd_pcm_delay' doesn't really hint at any hwsync operation.
>>
>> Just a naming difference really.
> 
> Yes, but also the difference of the number of arguments.  Changing
> other way round would need to more modifications in the end.

Ah yes, makes sense

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart at linux.intel.com>


More information about the Alsa-devel mailing list