mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-03-08 05:34:03 -04:00
module-rtp: improve properties and some cleanups
This commit is contained in:
parent
c46e021734
commit
7a31278511
4 changed files with 45 additions and 32 deletions
|
|
@ -94,7 +94,7 @@ static void process_audio_playback(void *data)
|
|||
pw_stream_queue_buffer(impl->stream, buf);
|
||||
}
|
||||
|
||||
static void receive_rtp_audio(struct impl *impl, uint8_t *buffer, ssize_t len)
|
||||
static int receive_rtp_audio(struct impl *impl, uint8_t *buffer, ssize_t len)
|
||||
{
|
||||
struct rtp_header *hdr;
|
||||
ssize_t hlen, plen;
|
||||
|
|
@ -110,7 +110,6 @@ static void receive_rtp_audio(struct impl *impl, uint8_t *buffer, ssize_t len)
|
|||
if (hdr->v != 2)
|
||||
goto invalid_version;
|
||||
|
||||
|
||||
hlen = 12 + hdr->cc * 4;
|
||||
if (hlen > len)
|
||||
goto invalid_len;
|
||||
|
|
@ -175,22 +174,22 @@ static void receive_rtp_audio(struct impl *impl, uint8_t *buffer, ssize_t len)
|
|||
write += samples;
|
||||
spa_ringbuffer_write_update(&impl->ring, write);
|
||||
}
|
||||
return;
|
||||
return 0;
|
||||
|
||||
short_packet:
|
||||
pw_log_warn("short packet received");
|
||||
return;
|
||||
return -EINVAL;
|
||||
invalid_version:
|
||||
pw_log_warn("invalid RTP version");
|
||||
spa_debug_mem(0, buffer, len);
|
||||
return;
|
||||
return -EPROTO;
|
||||
invalid_len:
|
||||
pw_log_warn("invalid RTP length");
|
||||
return;
|
||||
return -EINVAL;
|
||||
unexpected_ssrc:
|
||||
pw_log_warn("unexpected SSRC (expected %u != %u)",
|
||||
impl->ssrc, hdr->ssrc);
|
||||
return;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue