Skip to content

Commit

Permalink
Fix to store RTP port number in dump format
Browse files Browse the repository at this point in the history
The port number was added by one which was RTCP port.
  • Loading branch information
mcd500 committed Jul 15, 2018
1 parent c3e38bb commit f9b3498
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions rtpdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,7 @@ static int open_network(char *host, int data, int sock[], struct
struct ip_mreq mreq; /* multicast group */
int i;
int nfds = 0;

if (hpt(host, sin, NULL) == -1) {
usage("");
exit(1);
}

/* multicast */
if (host) {
mreq.imr_multiaddr = sin->sin_addr;
Expand Down Expand Up @@ -622,7 +618,7 @@ int main(int argc, char *argv[])
{0,0}
};
t_format format = F_ascii;
struct sockaddr_in sin;
struct sockaddr_in sin, rtp;
struct timeval start;
struct timeval timeout; /* timeout to limit recording */
double dstart; /* time as double */
Expand Down Expand Up @@ -723,14 +719,19 @@ int main(int argc, char *argv[])
}
else {
source = FromNetwork;
if (hpt(argv[optind], &sin, NULL) == -1) {
usage(argv[0]);
exit(1);
}
rtp = sin;
nfds = open_network(argv[optind], format != F_rtcp, sock, &sin);
gettimeofday(&start, 0);
dstart = tdbl(&start);
}

/* write header for dump file */
if (format == F_dump || format == F_header)
rtpdump_header(out, &sin, &start);
rtpdump_header(out, &rtp, &start);

/* signal handler */
signal(SIGINT, done);
Expand Down

1 comment on commit f9b3498

@mcd500
Copy link
Contributor Author

@mcd500 mcd500 commented on f9b3498 Jul 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes #123.

Please sign in to comment.