sysaudio: access sample rate from field (except for jack) and add media role option

This commit is contained in:
Ali Chraghi 2023-01-19 17:34:21 +03:30 committed by Stephen Gutekanst
parent bb6a654c90
commit 7315d1ab62
6 changed files with 41 additions and 44 deletions

View file

@ -206,10 +206,12 @@ pub const Player = struct {
fn processCallback(n_frames: c.jack_nframes_t, self_opaque: ?*anyopaque) callconv(.C) c_int {
const self = @ptrCast(*Player, @alignCast(@alignOf(*Player), self_opaque.?));
for (self.channels) |*ch, i| {
ch.*.ptr = @ptrCast([*]u8, c.jack_port_get_buffer(self.ports[i], n_frames));
}
self.writeFn(self.user_data, n_frames);
return 0;
}