diff options
author | Thibaut Mattern <tmattern@users.sourceforge.net> | 2003-01-28 23:15:15 +0000 |
---|---|---|
committer | Thibaut Mattern <tmattern@users.sourceforge.net> | 2003-01-28 23:15:15 +0000 |
commit | 0f7fd5a911b7147785f6e3097656de3e478eea92 (patch) | |
tree | f396224af62ce3bdd6b5e1ea92361663257b506d /src | |
parent | 699cd1ced66dc1ae4b72afc45352c486b9a6a7b1 (diff) | |
download | xine-lib-0f7fd5a911b7147785f6e3097656de3e478eea92.tar.gz xine-lib-0f7fd5a911b7147785f6e3097656de3e478eea92.tar.bz2 |
Fixes end of stream problem.
CVS patchset: 4027
CVS date: 2003/01/28 23:15:15
Diffstat (limited to 'src')
-rw-r--r-- | src/input/input_http.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/input/input_http.c b/src/input/input_http.c index 02a9a6974..102dd5e96 100644 --- a/src/input/input_http.c +++ b/src/input/input_http.c @@ -435,9 +435,9 @@ static off_t http_plugin_read (input_plugin_t *this_gen, n = read (this->fh, &buf[num_bytes], n); } } - - if (n <= 0) { - + + /* read errors */ + if (n < 0) { switch (errno) { case EAGAIN: xine_log (this->stream->xine, XINE_LOG_MSG, _("input_http: EAGAIN\n")); @@ -450,6 +450,9 @@ static off_t http_plugin_read (input_plugin_t *this_gen, num_bytes += n; this->curpos += n; + + /* end of stream */ + if (!n) break; } return num_bytes; } @@ -886,7 +889,7 @@ static input_plugin_t *open_plugin (input_class_t *cls_gen, xine_stream_t *strea this->preview_size = http_plugin_read (&this->input_plugin, this->preview, PREVIEW_SIZE); - + this->preview_pos = 0; this->curpos = 0; |