From: Juho Vähä-Herttua Date: Sun, 31 Mar 2013 10:42:31 +0000 (+0300) Subject: Pass on rtpmap to raop_buffer in order to add AAC support later X-Git-Tag: upstream/0.9.0~4^2~41 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=597bc69b0a31b9f1834911aeb34e389f28ea0ae7;p=deb_shairplay.git Pass on rtpmap to raop_buffer in order to add AAC support later --- diff --git a/src/lib/raop.c b/src/lib/raop.c index abf6630..10c2f12 100644 --- a/src/lib/raop.c +++ b/src/lib/raop.c @@ -203,15 +203,17 @@ conn_request(void *ptr, http_request_t *request, http_response_t **response) data = http_request_get_data(request, &datalen); if (data) { sdp_t *sdp; - const char *remotestr, *fmtpstr, *aeskeystr, *aesivstr; + const char *remotestr, *rtpmapstr, *fmtpstr, *aeskeystr, *aesivstr; sdp = sdp_init(data, datalen); remotestr = sdp_get_connection(sdp); + rtpmapstr = sdp_get_rtpmap(sdp); fmtpstr = sdp_get_fmtp(sdp); aeskeystr = sdp_get_rsaaeskey(sdp); aesivstr = sdp_get_aesiv(sdp); logger_log(conn->raop->logger, LOGGER_DEBUG, "connection: %s", remotestr); + logger_log(conn->raop->logger, LOGGER_DEBUG, "rtpmap: %s", rtpmapstr); logger_log(conn->raop->logger, LOGGER_DEBUG, "fmtp: %s", fmtpstr); logger_log(conn->raop->logger, LOGGER_DEBUG, "rsaaeskey: %s", aeskeystr); logger_log(conn->raop->logger, LOGGER_DEBUG, "aesiv: %s", aesivstr); @@ -226,7 +228,7 @@ conn_request(void *ptr, http_request_t *request, http_response_t **response) raop_rtp_destroy(conn->raop_rtp); conn->raop_rtp = NULL; } - conn->raop_rtp = raop_rtp_init(raop->logger, &raop->callbacks, remotestr, fmtpstr, aeskey, aesiv); + conn->raop_rtp = raop_rtp_init(raop->logger, &raop->callbacks, remotestr, rtpmapstr, fmtpstr, aeskey, aesiv); sdp_destroy(sdp); } } else if (!strcmp(method, "SETUP")) { diff --git a/src/lib/raop_buffer.c b/src/lib/raop_buffer.c index 37bfa79..15f588c 100644 --- a/src/lib/raop_buffer.c +++ b/src/lib/raop_buffer.c @@ -146,7 +146,8 @@ set_decoder_info(alac_file *alac, ALACSpecificConfig *config) } raop_buffer_t * -raop_buffer_init(const char *fmtp, +raop_buffer_init(const char *rtpmap, + const char *fmtp, const unsigned char *aeskey, const unsigned char *aesiv) { @@ -155,6 +156,7 @@ raop_buffer_init(const char *fmtp, ALACSpecificConfig *alacConfig; int i; + assert(rtpmap); assert(fmtp); assert(aeskey); assert(aesiv); diff --git a/src/lib/raop_buffer.h b/src/lib/raop_buffer.h index cfc6ab9..bed0ef4 100644 --- a/src/lib/raop_buffer.h +++ b/src/lib/raop_buffer.h @@ -34,7 +34,8 @@ typedef struct { typedef int (*raop_resend_cb_t)(void *opaque, unsigned short seqno, unsigned short count); -raop_buffer_t *raop_buffer_init(const char *fmtp, +raop_buffer_t *raop_buffer_init(const char *rtpmap, + const char *fmtp, const unsigned char *aeskey, const unsigned char *aesiv); diff --git a/src/lib/raop_rtp.c b/src/lib/raop_rtp.c index f89538e..e80da78 100644 --- a/src/lib/raop_rtp.c +++ b/src/lib/raop_rtp.c @@ -121,13 +121,15 @@ raop_rtp_parse_remote(raop_rtp_t *raop_rtp, const char *remote) raop_rtp_t * raop_rtp_init(logger_t *logger, raop_callbacks_t *callbacks, const char *remote, - const char *fmtp, const unsigned char *aeskey, const unsigned char *aesiv) + const char *rtpmap, const char *fmtp, + const unsigned char *aeskey, const unsigned char *aesiv) { raop_rtp_t *raop_rtp; assert(logger); assert(callbacks); assert(remote); + assert(rtpmap); assert(fmtp); raop_rtp = calloc(1, sizeof(raop_rtp_t)); @@ -136,7 +138,7 @@ raop_rtp_init(logger_t *logger, raop_callbacks_t *callbacks, const char *remote, } raop_rtp->logger = logger; memcpy(&raop_rtp->callbacks, callbacks, sizeof(raop_callbacks_t)); - raop_rtp->buffer = raop_buffer_init(fmtp, aeskey, aesiv); + raop_rtp->buffer = raop_buffer_init(rtpmap, fmtp, aeskey, aesiv); if (!raop_rtp->buffer) { free(raop_rtp); return NULL; diff --git a/src/lib/raop_rtp.h b/src/lib/raop_rtp.h index 19734fc..51cd891 100644 --- a/src/lib/raop_rtp.h +++ b/src/lib/raop_rtp.h @@ -26,7 +26,8 @@ typedef struct raop_rtp_s raop_rtp_t; raop_rtp_t *raop_rtp_init(logger_t *logger, raop_callbacks_t *callbacks, const char *remote, - const char *fmtp, const unsigned char *aeskey, const unsigned char *aesiv); + const char *rtpmap, const char *fmtp, + const unsigned char *aeskey, const unsigned char *aesiv); void raop_rtp_start(raop_rtp_t *raop_rtp, int use_udp, unsigned short control_rport, unsigned short timing_rport, unsigned short *control_lport, unsigned short *timing_lport, unsigned short *data_lport); void raop_rtp_set_volume(raop_rtp_t *raop_rtp, float volume);