summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaromil <jaromil@dyne.org>2011-08-16 15:04:23 (GMT)
committer Jaromil <jaromil@dyne.org>2011-08-16 15:04:23 (GMT)
commitc8661094376d34b89ff72685684b1fb9e16e55f1 (patch)
treee8d43f78cf17f469889b96d6db8fc02005a789d2
parent55158c93601ef8c7bbe0c44af2982e437682aa28 (diff)
compiles hdsync dependent from avremote sourcebase
we're importing latest avremote and then changing the CLI
-rw-r--r--.gitignore1
-rw-r--r--src/Makefile.am4
-rw-r--r--src/cmdline.c23
3 files changed, 21 insertions, 7 deletions
diff --git a/.gitignore b/.gitignore
index 2535307..e16dd9f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
src/broadcaster
src/netcat
src/avremote
+src/hdsync
*~
*.o
*.log
diff --git a/src/Makefile.am b/src/Makefile.am
index 2dab300..fea2222 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,4 @@
-bin_PROGRAMS = netcat broadcaster avremote
+bin_PROGRAMS = netcat broadcaster hdsync
netcat_SOURCES = \
core.c \
@@ -11,7 +11,7 @@ netcat_SOURCES = \
broadcaster_SOURCES = broadcaster.cpp
-avremote_SOURCES = avremote.c avremote.h cmdline.c parsers.c parsers.h
+hdsync_SOURCES = avremote.c avremote.h cmdline.c parsers.c parsers.h
netcat_nc = $(DESTDIR)$(bindir)/nc
diff --git a/src/cmdline.c b/src/cmdline.c
index ab0211a..9104633 100644
--- a/src/cmdline.c
+++ b/src/cmdline.c
@@ -40,6 +40,10 @@
// uncomment to debug
#define DEBUG 1
+// uncomment to also use UPNP discovery
+// (depends from miniupnp library)
+// #define UPNP_DISCOVERY 1
+
char filename[512];
char command[64];
char server[512];
@@ -74,7 +78,9 @@ void cmdline(int argc, char **argv) {
"\n"
"Commands:\n"
"\n"
+#ifdef UPNP_DISCOVERY
" discover scan for upnp devices on the network\n"
+#endif
" load load a file and prepare it for playback\n"
" mode set playback mode (NORMAL or REPEAT_ONE)\n"
" play start playing the selected file\n"
@@ -137,14 +143,16 @@ void cmdline(int argc, char **argv) {
} while(res != -1);
+#ifdef UPNP_DISCOVERY
if(command[0] == 'd') { // discover
discover = 1;
- } else if(!dry_run) {
- // check requires args
- if( command[0]=='-' && !command[1]) pipe_stdin++;
+ } else
+#endif
-
- }
+ if(!dry_run) {
+ // check requires args
+ if( command[0]=='-' && !command[1]) pipe_stdin++;
+ }
}
@@ -156,6 +164,7 @@ int main(int argc, char **argv) {
upnp = create_upnp();
+#ifdef UPNP_DISCOVERY
// no server specified, force discovery
if(!server[0] || !port) discover = 1;
@@ -171,6 +180,7 @@ int main(int argc, char **argv) {
}
}
+#endif
// commandline or detection found explicit addresses
snprintf(upnp->hostname, MAX_HOSTNAME_SIZE-1,"%s",server);
@@ -228,6 +238,9 @@ int main(int argc, char **argv) {
switch(command[0]) {
case 'd': // discovery
+#ifndef UPNP_DISCOVER
+ fprintf(stderr,"UPNP discovery feature not enabled for this binary\n");
+#endif
// was processed earlier
break;