[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r11774: Correctly stream video files
From: |
Rob Savoye |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r11774: Correctly stream video files by not ignoring the file header in the |
Date: |
Tue, 19 Jan 2010 16:35:43 -0700 |
User-agent: |
Bazaar (2.0.2) |
------------------------------------------------------------
revno: 11774
committer: Rob Savoye <address@hidden>
branch nick: trunk
timestamp: Tue 2010-01-19 16:35:43 -0700
message:
Correctly stream video files by not ignoring the file header in the
first packet.
Adjust the timeout between packets so as not to overwhelm the browser
with too much data, too fast.
modified:
cygnal/cygnal.cpp
libnet/diskstream.cpp
libnet/network.cpp
=== modified file 'cygnal/cygnal.cpp'
--- a/cygnal/cygnal.cpp 2010-01-19 21:00:32 +0000
+++ b/cygnal/cygnal.cpp 2010-01-19 23:35:43 +0000
@@ -1076,7 +1076,6 @@
break;
case Network::HTTP:
{
- net.setTimeout(30);
largs.netfd = i;
// largs.filespec = fullpath;
boost::shared_ptr<HTTPServer> &http =
hand->getHTTPHandler(i);
@@ -1142,8 +1141,10 @@
// args->buffer->clear();
// largs.buffer->clear();
- // Wait for something from one of the file descriptors
- net.setTimeout(30);
+ // Wait for something from one of the file descriptors. This timeout
+ // is the time between sending packets to the client when there is
+ // no client input, which effects the streaming speed of big files.
+ net.setTimeout(10);
hits = net.waitForNetData(hand->getClients());
if (FD_ISSET(0, &hits)) {
FD_CLR(0, &hits);
@@ -1152,8 +1153,8 @@
// hand->removeClient(args->netfd);
// done = true;
}
-#if 0
retries++;
+#if 0
if (retries >= 10) {
net.closeNet(args->netfd);
hand->removeClient(args->netfd);
=== modified file 'libnet/diskstream.cpp'
--- a/libnet/diskstream.cpp 2010-01-19 21:00:32 +0000
+++ b/libnet/diskstream.cpp 2010-01-19 23:35:43 +0000
@@ -528,7 +528,7 @@
}
// The data pointer points to the real data past all the header bytes.
- _dataptr = ptr;
+// _dataptr = ptr;
return _seekptr;
}
=== modified file 'libnet/network.cpp'
--- a/libnet/network.cpp 2010-01-15 02:08:00 +0000
+++ b/libnet/network.cpp 2010-01-19 23:35:43 +0000
@@ -1414,15 +1414,15 @@
// Reset the timeout value, since select modifies it on return
int timeout = _timeout;
if (timeout <= 0) {
- timeout = 5;
+ timeout = 30;
}
-#ifdef HAVE_PSELECT
+#ifdef HAVE_PSELECT_XX
struct timespec tval;
sigset_t pending, sigmask;
sigprocmask(SIG_BLOCK, &sigmask, NULL);
tval.tv_sec = 0;
- tval.tv_nsec = timeout * 1000;
+ tval.tv_nsec = timeout * 1000000000;
int ret = pselect(limit+1, &fdset, NULL, NULL, &tval, &sigmask);
sigpending(&pending);
if (sigismember(&pending, SIGINT)) {
@@ -1438,7 +1438,7 @@
#else
struct timeval tval;
tval.tv_sec = 0;
- tval.tv_usec = timeout;
+ tval.tv_usec = timeout * 1000; // was 1000000
int ret = select(limit+1, &fdset, NULL, NULL, &tval);
FD_ZERO(&fdset);
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r11774: Correctly stream video files by not ignoring the file header in the,
Rob Savoye <=