Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
rtsp: cleanup rtpc -> rtcp
  • Loading branch information
perexg committed Oct 8, 2015
1 parent 8a3a07f commit 2c9b5b2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/http.h
Expand Up @@ -319,7 +319,7 @@ struct http_client {
char *hc_rtsp_session;
char *hc_rtp_dest;
int hc_rtp_port;
int hc_rtpc_port;
int hc_rtcp_port;
int hc_rtp_tcp;
int hc_rtcp_tcp;
int hc_rtcp_server_port;
Expand Down Expand Up @@ -377,7 +377,7 @@ static inline int rtsp_options( http_client_t *hc ) {

int rtsp_setup_decode( http_client_t *hc, int satip );
int rtsp_setup( http_client_t *hc, const char *path, const char *query,
const char *multicast_addr, int rtp_port, int rtpc_port );
const char *multicast_addr, int rtp_port, int rtcp_port );

static inline int
rtsp_play( http_client_t *hc, const char *path, const char *query ) {
Expand Down
4 changes: 2 additions & 2 deletions src/input/mpegts/satip/satip_frontend.c
Expand Up @@ -1179,7 +1179,7 @@ satip_frontend_input_thread ( void *aux )

if ((rtsp_flags & SATIP_SETUP_TCP) == 0) {
if (udp_bind_double(&rtp, &rtcp,
"satip", "rtp", "rtpc",
"satip", "rtp", "rtcp",
satip_frontend_bindaddr(lfe), lfe->sf_udp_rtp_port,
NULL, SATIP_BUF_SIZE, 16384, 4*1024, 4*1024) < 0) {
satip_frontend_tuning_error(lfe, tr);
Expand Down Expand Up @@ -1423,7 +1423,7 @@ satip_frontend_input_thread ( void *aux )
break;
if (r < 0 || ((rtsp_flags & SATIP_SETUP_TCP) == 0 &&
(rtsp->hc_rtp_port != rtp_port ||
rtsp->hc_rtpc_port != rtp_port + 1)) ||
rtsp->hc_rtcp_port != rtp_port + 1)) ||
((rtsp_flags & SATIP_SETUP_TCP) != 0 &&
(rtsp->hc_rtp_tcp < 0 || rtsp->hc_rtcp_tcp < 0))) {
tvhlog(LOG_ERR, "satip", "%s - RTSP SETUP error %d (%s) [%i-%i]",
Expand Down
16 changes: 8 additions & 8 deletions src/rtsp.c
Expand Up @@ -61,7 +61,7 @@ rtsp_clear_session( http_client_t *hc )
free(hc->hc_rtsp_session);
free(hc->hc_rtp_dest);
hc->hc_rtp_port = 0;
hc->hc_rtpc_port = 0;
hc->hc_rtcp_port = 0;
hc->hc_rtsp_session = NULL;
hc->hc_rtp_dest = NULL;
hc->hc_rtp_multicast = 0;
Expand Down Expand Up @@ -150,7 +150,7 @@ rtsp_setup_decode( http_client_t *hc, int satip )
hc->hc_rtp_tcp = -1;
hc->hc_rtcp_tcp = -1;
hc->hc_rtp_port = -1;
hc->hc_rtpc_port = -1;
hc->hc_rtcp_port = -1;
if (!strcasecmp(argv[0], "RTP/AVP/TCP")) {
for (i = 1; i < n; i++) {
if (strncmp(argv[i], "interleaved=", 12) == 0) {
Expand Down Expand Up @@ -185,8 +185,8 @@ rtsp_setup_decode( http_client_t *hc, int satip )
if (hc->hc_rtp_port <= 0)
return -EIO;
if (j > 1) {
hc->hc_rtpc_port = atoi(argv2[1]);
if (hc->hc_rtpc_port <= 0)
hc->hc_rtcp_port = atoi(argv2[1]);
if (hc->hc_rtcp_port <= 0)
return -EIO;
}
} else {
Expand Down Expand Up @@ -214,21 +214,21 @@ int
rtsp_setup( http_client_t *hc,
const char *path, const char *query,
const char *multicast_addr,
int rtp_port, int rtpc_port )
int rtp_port, int rtcp_port )
{
http_arg_list_t h;
char transport[256];

if (rtpc_port < 0) {
if (rtcp_port < 0) {
snprintf(transport, sizeof(transport),
"RTP/AVP/TCP;interleaved=%d-%d", rtp_port, rtp_port + 1);
} else if (multicast_addr) {
snprintf(transport, sizeof(transport),
"RTP/AVP;multicast;destination=%s;ttl=1;client_port=%i-%i",
multicast_addr, rtp_port, rtpc_port);
multicast_addr, rtp_port, rtcp_port);
} else {
snprintf(transport, sizeof(transport),
"RTP/AVP;unicast;client_port=%i-%i", rtp_port, rtpc_port);
"RTP/AVP;unicast;client_port=%i-%i", rtp_port, rtcp_port);
}

http_arg_init(&h);
Expand Down

0 comments on commit 2c9b5b2

Please sign in to comment.