From 92fe79269011f6e6cd197cdff854c6b5efbd999c Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Thu, 3 Jun 2004 12:19:34 +0000 Subject: EOF when read returns <= 0 (thanks Leon van Stuivenberg) CVS patchset: 6632 CVS date: 2004/06/03 12:19:34 --- src/libflac/demux_flac.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/libflac/demux_flac.c b/src/libflac/demux_flac.c index 7de820321..dadc03e2e 100644 --- a/src/libflac/demux_flac.c +++ b/src/libflac/demux_flac.c @@ -109,10 +109,10 @@ flac_read_callback (const FLAC__SeekableStreamDecoder *decoder, lprintf("Read %lld / %u bytes into buffer\n", offset, *bytes); - *bytes = offset; /* This is the way to detect EOF with xine input plugins */ - if ( (offset != *bytes) && (*bytes != 0) ) + if ( offset <= 0 && *bytes != 0 ) { + *bytes = offset; lprintf("Marking EOF\n"); this->status = DEMUX_FINISHED; @@ -120,6 +120,7 @@ flac_read_callback (const FLAC__SeekableStreamDecoder *decoder, } else { + *bytes = offset; lprintf("Read was perfect\n"); return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK; -- cgit v1.2.3