summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaromil <jaromil@dyne.org>2011-05-24 14:36:49 (GMT)
committer Jaromil <jaromil@dyne.org>2011-05-24 14:36:49 (GMT)
commitf4ce1fe53911981076d39aa6369fee7ef62b8f70 (patch)
tree19d58ca27b3f96394dc5d38c03aafdbc2aac0295
parentba32023a9b339e2f428fd7ccb3a1d52c6e4cca55 (diff)
seek now works! commandline: jump
-rw-r--r--src/cmdline.c14
-rw-r--r--src/discover.c10
2 files changed, 14 insertions, 10 deletions
diff --git a/src/cmdline.c b/src/cmdline.c
index 52b9e86..dadab6a 100644
--- a/src/cmdline.c
+++ b/src/cmdline.c
@@ -81,6 +81,7 @@ void cmdline(int argc, char **argv) {
" pause pause currently running playback\n"
" stop stop playback and return to menu\n"
" get get the current status of the device\n"
+ " jump seek to a position in time (00:00:00)\n"
"\n"
"Options:\n"
"\n"
@@ -167,7 +168,7 @@ int main(int argc, char **argv) {
if (discover)
{
fprintf(stderr,"Performing upnp discovery...\n");
- upnp_discover();
+ upnp_discover(dry_run);
exit(0);
}
@@ -198,7 +199,7 @@ int main(int argc, char **argv) {
case 'l': // load url
render_uri_meta(upnp,filename);
render_upnp(upnp,"SetAVTransportURI", upnp->meta);
- send_upnp(upnp);
+ // send_upnp(upnp);
break;
case 'p':
@@ -236,6 +237,15 @@ int main(int argc, char **argv) {
}
break;
+ case 'j': // jump aka seek
+ // <SeekMode> and <SeekTarget>
+ {
+ char tmp[512];
+ snprintf(tmp,511,"<Unit>REL_TIME</Unit><Target>%s</Target>",filename);
+ render_upnp(upnp,"Seek",tmp);
+ }
+ break;
+
default:
fprintf(stderr,"warning: command not recognized, sending anyway.\n");
render_upnp(upnp,command,"");
diff --git a/src/discover.c b/src/discover.c
index ee365d6..ae0e3fa 100644
--- a/src/discover.c
+++ b/src/discover.c
@@ -57,7 +57,7 @@ int upnp_discover()
} else if (r == 3) { // 3 = an UPnP root device has been found (not an IGD)
dev = devlist;
- while(dev) {
+ for( dev = devlist; dev; dev = dev->pNext) {
// parse out ip and port from url
char ip[256];
@@ -79,15 +79,9 @@ int upnp_discover()
snprintf(port,63,"%s",p);
fprintf(stderr,"%s\t%s\t%s\t%s\n", dev->st, dev->descURL, ip, port);
- dev = dev->pNext;
+
}
- /* fprintf(stderr,
- " controlURL: %s\n"
- " ipcondescURL: %s\n"
- " controlURL_CIF: %s\n",
- urls.controlURL, urls.ipcondescURL, urls.controlURL_CIF); */
-
FreeUPNPUrls(&urls);
}
freeUPNPDevlist(devlist); devlist = 0;