summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaromil <jaromil@dyne.org>2012-02-21 11:40:13 (GMT)
committer Jaromil <jaromil@dyne.org>2012-02-21 11:40:56 (GMT)
commitcd64abc335f06346fb76ba7a39c34079be543902 (patch)
treeb64db0c5ed51f417e963569fa3e7b8348db98b72
parentf1b0539d53a378dd74caaa7f37d94fb0bee193b4 (diff)
stream playback also from ftp://
some fixes in autodiscovery
-rw-r--r--src/avremote.c2
-rw-r--r--src/cmdline.c22
2 files changed, 11 insertions, 13 deletions
diff --git a/src/avremote.c b/src/avremote.c
index 0524834..ce3b604 100644
--- a/src/avremote.c
+++ b/src/avremote.c
@@ -147,6 +147,8 @@ void render_uri_meta(upnp_t *upnp, char *path) {
pfile = basename(file);
if( strncmp(path,"http://",7)==0 )
snprintf(url,1023,"%s",path);
+ else if( strncmp(path,"ftp://",6)==0 )
+ snprintf(url,1023,"%s",path);
else
snprintf(url,1023,"file://%s",path);
diff --git a/src/cmdline.c b/src/cmdline.c
index dfeeddc..ab0211a 100644
--- a/src/cmdline.c
+++ b/src/cmdline.c
@@ -164,21 +164,17 @@ int main(int argc, char **argv) {
fprintf(stderr,"Performing upnp discovery...\n");
found = upnp_discover(upnp);
- // we exit in case none or more than one found and no manual
- // server:port was specified
- if(!server[0] || !port)
- {
- if(found != 1)
- exit(0);
- }
- else
- { // commandline specified explicit addresses
- snprintf(upnp->hostname, MAX_HOSTNAME_SIZE-1,"%s",server);
- upnp->port = port;
- }
+ if(found != 1) {
+ fprintf(stderr,"Please specify a target device host and port.\n");
+ free_upnp(upnp);
+ exit(0);
+ }
}
-
+
+ // commandline or detection found explicit addresses
+ snprintf(upnp->hostname, MAX_HOSTNAME_SIZE-1,"%s",server);
+ upnp->port = port;
if(!dry_run)
{