]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
timeshift: fix bug that can cause failure when seeking hits start of file
authorAdam Sutton <dev@adamsutton.me.uk>
Fri, 22 Feb 2013 11:11:10 +0000 (11:11 +0000)
committerAdam Sutton <dev@adamsutton.me.uk>
Fri, 22 Feb 2013 11:26:58 +0000 (11:26 +0000)
this resulted in a failed read that terminated the timeshift buffer.
(cherry picked from commit 229a8d75d850a1dfd8694959e5e1114c5366f294)

src/timeshift/timeshift_reader.c

index e2d4437ef0d1515a8998ec8dee130fa91dfa5af8..1e9e54838dac35a10074a4c797363ae02de29278 100644 (file)
@@ -322,12 +322,10 @@ static int _timeshift_read
 #endif
       *fd = open((*cur_file)->path, O_RDONLY);
     }
-    if (*cur_off) {
 #ifdef TSHFT_TRACE
-      tvhlog(LOG_DEBUG, "timeshift", "ts %d seek to %lu", ts->id, *cur_off);
+    tvhlog(LOG_DEBUG, "timeshift", "ts %d seek to %lu", ts->id, *cur_off);
 #endif
-      lseek(*fd, *cur_off, SEEK_SET);
-    }
+    lseek(*fd, *cur_off, SEEK_SET);
 
     /* Read msg */
     ssize_t r = _read_msg(*fd, sm);