Thread: [Redbutton-devel] SF.net SVN: redbutton: [16] redbutton-browser/trunk/MHEGBackend.c
Brought to you by:
skilvington
|
From: <ski...@us...> - 2006-03-04 14:42:45
|
Revision: 16 Author: skilvington Date: 2006-03-04 06:42:35 -0800 (Sat, 04 Mar 2006) ViewCVS: http://svn.sourceforge.net/redbutton/?rev=16&view=rev Log Message: ----------- default backend is at 127.0.0.1 Modified Paths: -------------- redbutton-browser/trunk/MHEGBackend.c Modified: redbutton-browser/trunk/MHEGBackend.c =================================================================== --- redbutton-browser/trunk/MHEGBackend.c 2006-03-03 16:51:20 UTC (rev 15) +++ redbutton-browser/trunk/MHEGBackend.c 2006-03-04 14:42:35 UTC (rev 16) @@ -56,13 +56,15 @@ { bzero(b, sizeof(MHEGBackend)); + /* default backend is on the loopback */ + b->addr.sin_family = AF_INET; + b->addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + b->addr.sin_port = htons(DEFAULT_REMOTE_PORT); + if(remote) { /* backend is on a different host, srg_loc is the remote host[:port] */ b->fns = &remote_backend_fns; - b->addr.sin_family = AF_INET; - b->addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - b->addr.sin_port = htons(DEFAULT_REMOTE_PORT); if(parse_addr(srg_loc, &b->addr.sin_addr, &b->addr.sin_port) < 0) fatal("Unable to resolve host %s", srg_loc); verbose("Remote backend at %s:%u", inet_ntoa(b->addr.sin_addr), ntohs(b->addr.sin_port)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <ski...@us...> - 2006-03-26 13:45:17
|
Revision: 30 Author: skilvington Date: 2006-03-26 05:45:10 -0800 (Sun, 26 Mar 2006) ViewCVS: http://svn.sourceforge.net/redbutton/?rev=30&view=rev Log Message: ----------- avoid potential fclose(NULL) Modified Paths: -------------- redbutton-browser/trunk/MHEGBackend.c Modified: redbutton-browser/trunk/MHEGBackend.c =================================================================== --- redbutton-browser/trunk/MHEGBackend.c 2006-03-25 14:31:57 UTC (rev 29) +++ redbutton-browser/trunk/MHEGBackend.c 2006-03-26 13:45:10 UTC (rev 30) @@ -510,7 +510,7 @@ || fgets(pids, sizeof(pids), sock) == NULL) { fclose(sock); - sock = NULL; + return NULL; } /* update the PID variables */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <ski...@us...> - 2007-01-12 21:35:21
|
Revision: 178
http://svn.sourceforge.net/redbutton/?rev=178&view=rev
Author: skilvington
Date: 2007-01-12 13:35:14 -0800 (Fri, 12 Jan 2007)
Log Message:
-----------
how the frontend would tell a remote backend to retune
Modified Paths:
--------------
redbutton-browser/trunk/MHEGBackend.c
Modified: redbutton-browser/trunk/MHEGBackend.c
===================================================================
--- redbutton-browser/trunk/MHEGBackend.c 2007-01-12 17:23:33 UTC (rev 177)
+++ redbutton-browser/trunk/MHEGBackend.c 2007-01-12 21:35:14 UTC (rev 178)
@@ -596,9 +596,27 @@
void
remote_retune(MHEGBackend *t, OctetString *service)
{
+ char cmd[128];
+ FILE *sock;
+
+ snprintf(cmd, sizeof(cmd), "retune %u", si_get_service_id(service));
+
/* TODO */
fatal("TODO: Retune remote backend to '%.*s' (service_id %u)", service->size, service->data, si_get_service_id(service));
+ if((sock = remote_command(t, true, cmd)) == NULL
+ || remote_response(sock) != BACKEND_RESPONSE_OK)
+ {
+ error("Unable to retune to '%.*s' (service_id %u)", service->size, service->data, si_get_service_id(service));
+ }
+
+ /* a "retune" command closes the connection to the backend, so close our end */
+ if(t->be_sock != NULL)
+ {
+ fclose(t->be_sock);
+ t->be_sock = NULL;
+ }
+
return;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-01-15 15:25:21
|
Revision: 179
http://svn.sourceforge.net/redbutton/?rev=179&view=rev
Author: skilvington
Date: 2007-01-15 07:25:10 -0800 (Mon, 15 Jan 2007)
Log Message:
-----------
add missing \n to stop remote backend retune hanging
Modified Paths:
--------------
redbutton-browser/trunk/MHEGBackend.c
Modified: redbutton-browser/trunk/MHEGBackend.c
===================================================================
--- redbutton-browser/trunk/MHEGBackend.c 2007-01-12 21:35:14 UTC (rev 178)
+++ redbutton-browser/trunk/MHEGBackend.c 2007-01-15 15:25:10 UTC (rev 179)
@@ -599,10 +599,10 @@
char cmd[128];
FILE *sock;
- snprintf(cmd, sizeof(cmd), "retune %u", si_get_service_id(service));
+ snprintf(cmd, sizeof(cmd), "retune %u\n", si_get_service_id(service));
/* TODO */
-fatal("TODO: Retune remote backend to '%.*s' (service_id %u)", service->size, service->data, si_get_service_id(service));
+printf("TODO: Retune remote backend to '%.*s' (service_id %u). This will fail if the new service is on a different frequency.", service->size, service->data, si_get_service_id(service));
if((sock = remote_command(t, true, cmd)) == NULL
|| remote_response(sock) != BACKEND_RESPONSE_OK)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-01-18 22:39:04
|
Revision: 182
http://svn.sourceforge.net/redbutton/?rev=182&view=rev
Author: skilvington
Date: 2007-01-18 14:22:54 -0800 (Thu, 18 Jan 2007)
Log Message:
-----------
remove TODO comment
Modified Paths:
--------------
redbutton-browser/trunk/MHEGBackend.c
Modified: redbutton-browser/trunk/MHEGBackend.c
===================================================================
--- redbutton-browser/trunk/MHEGBackend.c 2007-01-18 22:22:31 UTC (rev 181)
+++ redbutton-browser/trunk/MHEGBackend.c 2007-01-18 22:22:54 UTC (rev 182)
@@ -601,9 +601,6 @@
snprintf(cmd, sizeof(cmd), "retune %u\n", si_get_service_id(service));
-/* TODO */
-printf("TODO: Retune remote backend to '%.*s' (service_id %u). This will fail if the new service is on a different frequency.", service->size, service->data, si_get_service_id(service));
-
if((sock = remote_command(t, true, cmd)) == NULL
|| remote_response(sock) != BACKEND_RESPONSE_OK)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-03-26 13:02:25
|
Revision: 260
http://svn.sourceforge.net/redbutton/?rev=260&view=rev
Author: skilvington
Date: 2007-03-26 05:48:39 -0700 (Mon, 26 Mar 2007)
Log Message:
-----------
don't set PIDs until we are sure we could open the stream
Modified Paths:
--------------
redbutton-browser/trunk/MHEGBackend.c
Modified: redbutton-browser/trunk/MHEGBackend.c
===================================================================
--- redbutton-browser/trunk/MHEGBackend.c 2007-03-25 17:52:09 UTC (rev 259)
+++ redbutton-browser/trunk/MHEGBackend.c 2007-03-26 12:48:39 UTC (rev 260)
@@ -256,11 +256,6 @@
return NULL;
}
- if(have_audio)
- *audio_tag = audio_pid;
- if(have_video)
- *video_tag = video_pid;
-
/* set up the MHEGStream */
stream = safe_malloc(sizeof(MHEGStream));
@@ -298,6 +293,12 @@
stream->demux = NULL;
}
+ /* now we are sure it all worked, set up the return values */
+ if(have_audio)
+ *audio_tag = audio_pid;
+ if(have_video)
+ *video_tag = video_pid;
+
return stream;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|