mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
hook: make spa_callbacks_call return true
Make spa_callbacks_call return true when the method could be called succesfully. This means the callbacks version was correct and the method existed. This can then be used to implement a fallback.
This commit is contained in:
parent
e36183d3cf
commit
bb950976da
1 changed files with 4 additions and 1 deletions
|
|
@ -171,12 +171,15 @@ struct spa_interface {
|
|||
/**
|
||||
* Invoke method named \a method in the \a callbacks.
|
||||
* The \a method_type defines the type of the method struct.
|
||||
* Returns true if the method could be called, false otherwise.
|
||||
*/
|
||||
#define spa_callbacks_call(callbacks,type,method,vers,...) \
|
||||
({ \
|
||||
const type *_f = (const type *) (callbacks)->funcs; \
|
||||
if (SPA_LIKELY(SPA_CALLBACK_CHECK(_f,method,vers))) \
|
||||
bool _res = SPA_CALLBACK_CHECK(_f,method,vers); \
|
||||
if (SPA_LIKELY(_res)) \
|
||||
_f->method((callbacks)->data, ## __VA_ARGS__); \
|
||||
_res; \
|
||||
})
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue