mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-07 13:30:09 -05:00
module-vban: create streams per stream_name
Always listen on the receive socket. Find the stream with the given stream_name of the packet and create it if it doesn't exist. Also take the sample-rate, channels and format from the packet parameters instead of the config. Fixes #4400
This commit is contained in:
parent
567b484386
commit
1a5514e5cf
6 changed files with 284 additions and 153 deletions
|
|
@ -92,12 +92,7 @@ static int vban_audio_receive(struct impl *impl, uint8_t *buffer, ssize_t len)
|
|||
uint32_t stride = impl->stride;
|
||||
int32_t filled;
|
||||
|
||||
if (len < VBAN_HEADER_SIZE)
|
||||
goto short_packet;
|
||||
|
||||
hdr = (struct vban_header*)buffer;
|
||||
if (strncmp(hdr->vban, "VBAN", 3))
|
||||
goto invalid_version;
|
||||
|
||||
impl->receiving = true;
|
||||
|
||||
|
|
@ -155,14 +150,6 @@ static int vban_audio_receive(struct impl *impl, uint8_t *buffer, ssize_t len)
|
|||
spa_ringbuffer_write_update(&impl->ring, write);
|
||||
}
|
||||
return 0;
|
||||
|
||||
short_packet:
|
||||
pw_log_warn("short packet received");
|
||||
return -EINVAL;
|
||||
invalid_version:
|
||||
pw_log_warn("invalid VBAN version");
|
||||
spa_debug_log_mem(pw_log_get(), SPA_LOG_LEVEL_INFO, 0, buffer, len);
|
||||
return -EPROTO;
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue