aboutsummaryrefslogtreecommitdiffstats
path: root/src/input
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-09-14 22:25:29 +0200
committerMax Kellermann <max@duempel.org>2011-09-14 22:25:29 +0200
commitad37c88f800a09b75ae3174269bcdf3584406837 (patch)
tree817b4d3755aaec18dc635e5cb25deeba7934dda9 /src/input
parent8c6e8a6eb87dfbb38c6a1047d0868f565837abfa (diff)
downloadmpd-ad37c88f800a09b75ae3174269bcdf3584406837.tar.gz
mpd-ad37c88f800a09b75ae3174269bcdf3584406837.tar.xz
mpd-ad37c88f800a09b75ae3174269bcdf3584406837.zip
input_plugin: add method update()
Update the struct attributes, important for facades like the "rewind" plugin. To replace buffer().
Diffstat (limited to 'src/input')
-rw-r--r--src/input/rewind_input_plugin.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/input/rewind_input_plugin.c b/src/input/rewind_input_plugin.c
index f4c4fa606..9d3255cfe 100644
--- a/src/input/rewind_input_plugin.c
+++ b/src/input/rewind_input_plugin.c
@@ -105,6 +105,15 @@ input_rewind_close(struct input_stream *is)
g_free(r);
}
+static void
+input_rewind_update(struct input_stream *is)
+{
+ struct input_rewind *r = (struct input_rewind *)is;
+
+ if (!reading_from_buffer(r))
+ copy_attributes(r);
+}
+
static struct tag *
input_rewind_tag(struct input_stream *is)
{
@@ -210,6 +219,7 @@ input_rewind_seek(struct input_stream *is, goffset offset, int whence,
static const struct input_plugin rewind_input_plugin = {
.close = input_rewind_close,
+ .update = input_rewind_update,
.tag = input_rewind_tag,
.buffer = input_rewind_buffer,
.read = input_rewind_read,