diff options
author | Robin KAY <komadori@users.sourceforge.net> | 2002-11-26 18:51:32 +0000 |
---|---|---|
committer | Robin KAY <komadori@users.sourceforge.net> | 2002-11-26 18:51:32 +0000 |
commit | 0c90474427f37b31889b2adea9d1c39c8b7e7618 (patch) | |
tree | e07dc8c532a5ef3debea4b34437dc7d3b0e00d8a /src/input/input_http.c | |
parent | df308d6eac8943344bb3fe491ee0453340a487b3 (diff) | |
download | xine-lib-0c90474427f37b31889b2adea9d1c39c8b7e7618.tar.gz xine-lib-0c90474427f37b31889b2adea9d1c39c8b7e7618.tar.bz2 |
change demux_eawve to use forward seeking. quick hack to input_http to support forward relative seeking.
CVS patchset: 3378
CVS date: 2002/11/26 18:51:32
Diffstat (limited to 'src/input/input_http.c')
-rw-r--r-- | src/input/input_http.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/input/input_http.c b/src/input/input_http.c index 1fbe13133..f180bc292 100644 --- a/src/input/input_http.c +++ b/src/input/input_http.c @@ -582,10 +582,18 @@ static off_t http_plugin_get_current_pos (input_plugin_t *this_gen){ return this->curpos; } -static off_t http_plugin_seek(input_plugin_t *this_gen, - off_t offset, int origin) { - +static off_t http_plugin_seek(input_plugin_t *this_gen, off_t offset, int origin) { http_input_plugin_t *this = (http_input_plugin_t *) this_gen; + + if ((origin == SEEK_CUR) && (offset >= 0)) { + char *tmp; + assert((tmp = malloc(1024)) != NULL); + for (;((int)offset) - 1024 > 0; offset -= 1024) { + this->curpos += http_plugin_read(this_gen, tmp, 1024); + } + this->curpos += http_plugin_read(this_gen, tmp, offset); + } + /* dummy implementation: don't seek, just return current position */ return this->curpos; } |