From: Jaroslav Kysela Date: Sun, 13 Dec 2015 21:01:13 +0000 (+0100) Subject: timeshift: correctly signal the end-of-data for RAM segment X-Git-Tag: v4.0.8~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e97fc0706dbe00035361e1d4f06deb42db69d9a5;p=thirdparty%2Ftvheadend.git timeshift: correctly signal the end-of-data for RAM segment --- diff --git a/src/timeshift/timeshift_reader.c b/src/timeshift/timeshift_reader.c index cd46140cd..b29718ac0 100644 --- a/src/timeshift/timeshift_reader.c +++ b/src/timeshift/timeshift_reader.c @@ -44,6 +44,7 @@ static ssize_t _read_buf ( timeshift_file_t *tsf, int fd, void *buf, size_t size ) { if (tsf && tsf->ram) { + if (tsf->roff == tsf->woff) return 0; if (tsf->roff + size > tsf->woff) return -1; pthread_mutex_lock(&tsf->ram_lock); memcpy(buf, tsf->ram + tsf->roff, size);