From 437cfb646da614b43d571261176d8fe8c8211100 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Fri, 23 Nov 2018 20:58:29 +0200 Subject: [PATCH] file: add restart callback --- lib/nodes/file.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/nodes/file.c b/lib/nodes/file.c index 14cee06bd..2ef56c841 100644 --- a/lib/nodes/file.c +++ b/lib/nodes/file.c @@ -317,6 +317,16 @@ int file_stop(struct node *n) return 0; } +int file_restart(struct node *n) +{ + struct file *f = (struct file *) n->_vd; + + f->offset = file_calc_offset(&f->first, &f->epoch, f->epoch_mode); + io_rewind(&f->io); + + return 0; +} + int file_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) { struct file *f = (struct file *) n->_vd; @@ -423,6 +433,7 @@ static struct plugin p = { .print = file_print, .start = file_start, .stop = file_stop, + .restart = file_restart, .read = file_read, .write = file_write, .fd = file_fd