aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputStream_http.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2005-12-05 03:53:56 +0000
committerEric Wong <normalperson@yhbt.net>2005-12-05 03:53:56 +0000
commit7a7886a193d4d2ecdf092bbd18e37739f2430be5 (patch)
tree9d5cf3b78e50803ec9d26d1ef6b2a36561d6fb34 /src/inputStream_http.c
parent3af3a551dfbd3299287b88980370de9dc98308fc (diff)
downloadmpd-7a7886a193d4d2ecdf092bbd18e37739f2430be5.tar.gz
mpd-7a7886a193d4d2ecdf092bbd18e37739f2430be5.tar.xz
mpd-7a7886a193d4d2ecdf092bbd18e37739f2430be5.zip
OggFLAC support
git-svn-id: https://svn.musicpd.org/mpd/branches/oggflac@3720 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/inputStream_http.c')
-rw-r--r--src/inputStream_http.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/inputStream_http.c b/src/inputStream_http.c
index dbb6d82d3..d3303eb87 100644
--- a/src/inputStream_http.c
+++ b/src/inputStream_http.c
@@ -708,6 +708,20 @@ int inputStream_httpOpen(InputStream * inStream, char * url) {
}
int inputStream_httpSeek(InputStream * inStream, long offset, int whence) {
+ /* hack to reopen an HTTP stream if we're trying to seek to
+ * the beginning */
+ if ((whence == SEEK_SET) && (offset == 0)) {
+ InputStreamHTTPData * data;
+
+ data = (InputStreamHTTPData*)inStream->data;
+ close(data->sock);
+ data->connState = HTTP_CONN_STATE_REOPEN;
+ data->buflen = 0;
+ inStream->offset = 0;
+ return 0;
+ }
+
+ /* otherwise, we don't know how to seek in HTTP yet */
return -1;
}