From 0f7fd5a911b7147785f6e3097656de3e478eea92 Mon Sep 17 00:00:00 2001 From: Thibaut Mattern Date: Tue, 28 Jan 2003 23:15:15 +0000 Subject: Fixes end of stream problem. CVS patchset: 4027 CVS date: 2003/01/28 23:15:15 --- src/input/input_http.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/input/input_http.c') 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; -- cgit v1.2.3