http: hopefully allow seeking to work on static files
git-svn-id: https://svn.musicpd.org/mpd/trunk@7398 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
c7d1ce07f3
commit
a889684acd
@ -686,7 +686,6 @@ static int recv_response(InputStream * is)
|
|||||||
parse_headers(is, response, needle);
|
parse_headers(is, response, needle);
|
||||||
if (is->size <= 0)
|
if (is->size <= 0)
|
||||||
is->seekable = 0;
|
is->seekable = 0;
|
||||||
is->seekable = 0;
|
|
||||||
needle += sizeof("\r\n\r\n") - 1;
|
needle += sizeof("\r\n\r\n") - 1;
|
||||||
peeked = needle - response;
|
peeked = needle - response;
|
||||||
assert(peeked <= r);
|
assert(peeked <= r);
|
||||||
@ -810,6 +809,8 @@ int inputStream_httpSeek(InputStream * is, long offset, int whence)
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff = is->offset - old_offset;
|
diff = is->offset - old_offset;
|
||||||
|
if (!diff)
|
||||||
|
return 0; /* nothing to seek */
|
||||||
if (diff > 0) { /* seek forward if we've already buffered it */
|
if (diff > 0) { /* seek forward if we've already buffered it */
|
||||||
long avail = (long)ringbuf_read_space(data->rb);
|
long avail = (long)ringbuf_read_space(data->rb);
|
||||||
if (avail >= diff) {
|
if (avail >= diff) {
|
||||||
|
Loading…
Reference in New Issue
Block a user