Skip to content

Commit

Permalink
EOF detection got false positives in file-cache. Fixes issue #111, FL…
Browse files Browse the repository at this point in the history
…AC files could fail to play
  • Loading branch information
mywave82 committed Mar 28, 2024
1 parent 93ec77f commit f596acd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion filesel/filesystem-filehandle-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ static int cache_filehandle_filesize_ready (struct ocpfilehandle_t *_s)
if (s->filesize_ready_cache)
{
s->filesize_cache = s->head.origin->filesize (s->head.origin);
s->maxpos = s->filesize_cache;
}
}

Expand All @@ -328,6 +329,7 @@ static uint64_t cache_filehandle_filesize (struct ocpfilehandle_t * _s)

s->filesize_ready_cache = 1;
s->filesize_cache = s->head.origin->filesize (s->head.origin);
s->maxpos = s->filesize_cache;
return s->filesize_cache;
}

Expand Down Expand Up @@ -381,7 +383,7 @@ static int cache_filehandle_eof (struct ocpfilehandle_t *_s)

oldpos = s->pos;
/* attempt to pull in more data */
cache_filehandle_seek_set (_s, s->maxpos + 1);
cache_filehandle_seek_set (_s, s->pos + 1);
cache_filehandle_seek_set (_s, oldpos);

if (s->pos < s->maxpos)
Expand Down

0 comments on commit f596acd

Please sign in to comment.