mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
apexsink: Use a union to avoid type-punning strict aliasing compiler warning.
This commit is contained in:
parent
3ee87fa8f2
commit
4a046a08a3
1 changed files with 17 additions and 7 deletions
|
@ -231,7 +231,17 @@ gst_apexraop_connect (GstApExRAOP * con)
|
||||||
creq[GST_APEX_RAOP_SDP_DEFAULT_LENGTH],
|
creq[GST_APEX_RAOP_SDP_DEFAULT_LENGTH],
|
||||||
hreq[GST_APEX_RAOP_HDR_DEFAULT_LENGTH], *req;
|
hreq[GST_APEX_RAOP_HDR_DEFAULT_LENGTH], *req;
|
||||||
RSA *rsa;
|
RSA *rsa;
|
||||||
guchar *mod, *exp, buf[4 + 8 + 16], rsakey[512];
|
guchar *mod, *exp, rsakey[512];
|
||||||
|
union gst_randbytes
|
||||||
|
{
|
||||||
|
struct asvals
|
||||||
|
{
|
||||||
|
gulong url_key;
|
||||||
|
guint64 conn_id;
|
||||||
|
guchar challenge[16];
|
||||||
|
} v;
|
||||||
|
guchar buf[4 + 8 + 16];
|
||||||
|
} randbuf;
|
||||||
gsize size;
|
gsize size;
|
||||||
struct sockaddr_in ioaddr;
|
struct sockaddr_in ioaddr;
|
||||||
socklen_t iolen;
|
socklen_t iolen;
|
||||||
|
@ -257,12 +267,9 @@ gst_apexraop_connect (GstApExRAOP * con)
|
||||||
sizeof (conn->ctrl_sd_in)) < 0)
|
sizeof (conn->ctrl_sd_in)) < 0)
|
||||||
return GST_RTSP_STS_DESTINATION_UNREACHABLE;
|
return GST_RTSP_STS_DESTINATION_UNREACHABLE;
|
||||||
|
|
||||||
RAND_bytes (buf, sizeof (buf));
|
RAND_bytes (randbuf.buf, sizeof (randbuf));
|
||||||
sprintf ((gchar *) conn->url_abspath, "%lu", *((gulong *) buf));
|
sprintf ((gchar *) conn->url_abspath, "%lu", randbuf.v.url_key);
|
||||||
ac = g_base64_encode (buf + 12, 16);
|
sprintf ((char *) conn->cid, "%16" G_GINT64_MODIFIER "x", randbuf.v.conn_id);
|
||||||
g_strdel (ac, '=');
|
|
||||||
sprintf ((char *) conn->cid, "%08lx%08lx", *((gulong *) (buf + 4)),
|
|
||||||
*((gulong *) (buf + 8)));
|
|
||||||
|
|
||||||
RAND_bytes (conn->aes_ky, AES_BLOCK_SIZE);
|
RAND_bytes (conn->aes_ky, AES_BLOCK_SIZE);
|
||||||
RAND_bytes (conn->aes_iv, AES_BLOCK_SIZE);
|
RAND_bytes (conn->aes_iv, AES_BLOCK_SIZE);
|
||||||
|
@ -285,6 +292,9 @@ gst_apexraop_connect (GstApExRAOP * con)
|
||||||
getsockname (conn->ctrl_sd, (struct sockaddr *) &ioaddr, &iolen);
|
getsockname (conn->ctrl_sd, (struct sockaddr *) &ioaddr, &iolen);
|
||||||
inet_ntop (AF_INET, &(ioaddr.sin_addr), inaddr, INET_ADDRSTRLEN);
|
inet_ntop (AF_INET, &(ioaddr.sin_addr), inaddr, INET_ADDRSTRLEN);
|
||||||
|
|
||||||
|
ac = g_base64_encode (randbuf.v.challenge, 16);
|
||||||
|
g_strdel (ac, '=');
|
||||||
|
|
||||||
sprintf (creq,
|
sprintf (creq,
|
||||||
"v=0\r\n"
|
"v=0\r\n"
|
||||||
"o=iTunes %s 0 IN IP4 %s\r\n"
|
"o=iTunes %s 0 IN IP4 %s\r\n"
|
||||||
|
|
Loading…
Reference in a new issue