[vlc-devel] [patch] pulseaudio API compatibility fix

jnqnfe at gmail.com jnqnfe at gmail.com
Fri Jul 6 01:10:47 CEST 2018


On Wed, 2018-07-04 at 21:55 +0300, Rémi Denis-Courmont wrote:
> Le torstaina 28. kesäkuuta 2018, 19.49.33 EEST jnqnfe at gmail.com a
> écrit :
> > Lately I've been sending in a lot of patches to PulseAudio to add
> > const
> > qualifiers to much of their API. For the most part this has not
> > changed
> > API compatibility in any way, however the latest set concerning the
> > pa_mainloop_api structure does.
> > 
> > The attached patch makes VLC compatible with the change, whilst
> > also
> > remaining compatible with the current API.
> > 
> > Specifically it adds the const qualifier to callback
> > pa_mainloop_api
> > params, and avoids storing the *_get_api() call result in a
> > variable.
> 
> Please keep it within 79 characters per line.

Oops, fixed.

> It might help to retain the intermadiate variables.

Would not help, the intermediate variable was deliberately removed.
Currently the `*_get_api()` functions return a non-const mainloop API
vtable pointer, and this is given to the context creation function,
which takes a non-const pointer. The API change includes adding const
to both of these. We can not keep the intermediate variable, adding
const to it, and remain compatible with the current API because context
creation current requires non-const. We can not keep the intermediate
variable without const and be compatible with the API change, since
`*_get_api()` will be returning const. Removing the intermediate
variable allows it to be compatible both before and after the API
change.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pa_const_api_ref.patch
Type: text/x-patch
Size: 1873 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20180706/86cfaed8/attachment.bin>


More information about the vlc-devel mailing list