mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
Improve loop callbacks
Pass just one data item to the callbacks. Add properties to port. Add user data to link Handle autolink with multiple ports More work on jack support
This commit is contained in:
parent
cfd9967637
commit
9ad1f911b2
38 changed files with 1773 additions and 271 deletions
|
|
@ -17,6 +17,8 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <semaphore.h>
|
||||
|
||||
struct jack_synchro {
|
||||
char name[SYNC_MAX_NAME_SIZE];
|
||||
bool flush;
|
||||
|
|
@ -46,3 +48,29 @@ jack_synchro_init(struct jack_synchro *synchro,
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
jack_synchro_signal(struct jack_synchro *synchro)
|
||||
{
|
||||
int res;
|
||||
if (synchro->flush)
|
||||
return true;
|
||||
if ((res = sem_post(synchro->semaphore)) < 0)
|
||||
pw_log_error("semaphore %s post err = %s", synchro->name, strerror(errno));
|
||||
|
||||
return res == 0;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
jack_synchro_wait(struct jack_synchro *synchro)
|
||||
{
|
||||
int res;
|
||||
while ((res = sem_wait(synchro->semaphore)) < 0) {
|
||||
if (errno != EINTR)
|
||||
continue;
|
||||
|
||||
pw_log_error("semaphore %s wait err = %s", synchro->name, strerror(errno));
|
||||
break;
|
||||
}
|
||||
return res == 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue