aboutsummaryrefslogtreecommitdiffstats
path: root/src/input/rewind_input_plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/input/rewind_input_plugin.c')
-rw-r--r--src/input/rewind_input_plugin.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/input/rewind_input_plugin.c b/src/input/rewind_input_plugin.c
index 0a874a29c..6daf94895 100644
--- a/src/input/rewind_input_plugin.c
+++ b/src/input/rewind_input_plugin.c
@@ -82,7 +82,6 @@ copy_attributes(struct input_stream *dest)
dest->ready = src->ready;
dest->seekable = src->seekable;
- dest->error = src->error;
dest->size = src->size;
dest->offset = src->offset;
@@ -111,11 +110,11 @@ input_rewind_tag(struct input_stream *is)
}
static int
-input_rewind_buffer(struct input_stream *is)
+input_rewind_buffer(struct input_stream *is, GError **error_r)
{
struct input_rewind *r = is->data;
- int ret = input_stream_buffer(&r->input);
+ int ret = input_stream_buffer(&r->input, error_r);
if (ret < 0 || !reading_from_buffer(is))
copy_attributes(is);
@@ -123,7 +122,8 @@ input_rewind_buffer(struct input_stream *is)
}
static size_t
-input_rewind_read(struct input_stream *is, void *ptr, size_t size)
+input_rewind_read(struct input_stream *is, void *ptr, size_t size,
+ GError **error_r)
{
struct input_rewind *r = is->data;
@@ -144,9 +144,9 @@ input_rewind_read(struct input_stream *is, void *ptr, size_t size)
} else {
/* pass method call to underlying stream */
- size_t nbytes = input_stream_read(&r->input, ptr, size);
+ size_t nbytes = input_stream_read(&r->input, ptr, size, error_r);
- if (r->input.offset > (off_t)sizeof(r->buffer))
+ if (r->input.offset > (goffset)sizeof(r->buffer))
/* disable buffering */
r->tail = 0;
else if (r->tail == (size_t)is->offset) {
@@ -173,13 +173,14 @@ input_rewind_eof(G_GNUC_UNUSED struct input_stream *is)
}
static bool
-input_rewind_seek(struct input_stream *is, off_t offset, int whence)
+input_rewind_seek(struct input_stream *is, goffset offset, int whence,
+ GError **error_r)
{
struct input_rewind *r = is->data;
assert(is->ready);
- if (whence == SEEK_SET && r->tail > 0 && offset <= (off_t)r->tail) {
+ if (whence == SEEK_SET && r->tail > 0 && offset <= (goffset)r->tail) {
/* buffered seek */
assert(!reading_from_buffer(is) ||
@@ -191,7 +192,8 @@ input_rewind_seek(struct input_stream *is, off_t offset, int whence)
return true;
} else {
- bool success = input_stream_seek(&r->input, offset, whence);
+ bool success = input_stream_seek(&r->input, offset, whence,
+ error_r);
copy_attributes(is);
/* disable the buffer, because r->input has left the