raop: only encrypt when enabled

This commit is contained in:
Wim Taymans 2021-11-12 18:10:39 +01:00
parent 4695bd32c4
commit 5d6690ebe7

View file

@ -361,7 +361,8 @@ static int flush_to_udp_packet(struct impl *impl)
memset(dst, 0, len);
break;
}
aes_encrypt(impl, dst, len);
if (impl->encryption != CRYPTO_NONE)
aes_encrypt(impl, dst, len);
impl->rtptime += n_frames;
impl->seq = (impl->seq + 1) & 0xffff;
@ -402,7 +403,8 @@ static int flush_to_tcp_packet(struct impl *impl)
memset(dst, 0, len);
break;
}
aes_encrypt(impl, dst, len);
if (impl->encryption != CRYPTO_NONE)
aes_encrypt(impl, dst, len);
pkt[0] |= htonl((uint32_t) len + 12);