summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaromil <jaromil@dyne.org>2012-05-19 15:55:51 (GMT)
committer Jaromil <jaromil@dyne.org>2012-05-19 15:57:36 (GMT)
commit17ff087db50324fcb809ed9e5980bb40ac66fa29 (patch)
tree0d72905a3b0d32af4ca825291046095dc4d142a4
parentbb9db29e1a547e2b6ef524c6e459aaaeec1bd94f (diff)
added manually specified pgm address
-rw-r--r--src/hdsync_cli.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/hdsync_cli.cpp b/src/hdsync_cli.cpp
index 886772a..832ae99 100644
--- a/src/hdsync_cli.cpp
+++ b/src/hdsync_cli.cpp
@@ -54,6 +54,7 @@
// commandline switches
char filename[512];
char server[512];
+char pgmstatic[256];
int port = 0;
int dryrun = 0;
int chanID = 0;
@@ -71,11 +72,11 @@ char IPv4[24];
void *zcontext;
void *sock_in = NULL;
void *sock_shout = NULL;
-char pgmaddr[64];
+char pgmaddr[256];
zmq_msg_t request;
// we use only getopt, no _long
-static const char *short_options = "-hvts:p:";
+static const char *short_options = "-hvta:s:p:";
void cmdline(int argc, char **argv);
@@ -428,6 +429,7 @@ int main(int argc, char **argv) {
void cmdline(int argc, char **argv) {
filename[0] = 0;
server[0] = 0;
+ pgmstatic[0] = 0;
int res;
do {
@@ -448,6 +450,7 @@ void cmdline(int argc, char **argv) {
" -s network address or hostname of the media server\n"
" -p port on which the UPNP AVTransport daemon is listening\n"
" -t dry run to test without a server (print out rendered xml)\n"
+ " -a manually specified pgm:// address for broadcast range\n"
"\n"
" -h print this help\n"
" -v version information for this tool\n"
@@ -469,6 +472,10 @@ void cmdline(int argc, char **argv) {
snprintf(server,511,"%s",optarg);
break;
+ case 'a':
+ snprintf(pgmstatic,255,"%s",optarg);
+ break;
+
case 'p':
sscanf (optarg, "%u", &port);
break;
@@ -518,7 +525,10 @@ int get_address() {
// printf("%s IP Address %s\n", ifa->ifa_name, addressBuffer);
if( strcmp(ifa->ifa_name, ETHDEV) == 0) {
strncpy(IPv4, addressBuffer, 16);
- snprintf(pgmaddr,63,"pgm://%s:%s",ifa->ifa_name, PGMPORT);
+ if( pgmstatic[0] != 0 )
+ snprintf(pgmaddr,255,"%s",pgmstatic);
+ else
+ snprintf(pgmaddr,255,"pgm://%s:%s",ifa->ifa_name, PGMPORT);
}
}
}