[vlc-devel] vlc: svn commit r23372 (ileoo)

Ilkka Ollakka ilkka.ollakka+vlc at oamk.fi
Tue Nov 27 16:21:40 CET 2007


On ti 27. marraskuuta 2007 15:37:51, Remi Denis-Courmont wrote:
> 
> On Tue, 27 Nov 2007 13:43:54 +0100 (CET), Subversion daemon
> <svn at videolan.org> wrote:
> > r23372 | ileoo | 2007-11-27 13:43:54 +0100 (Tue, 27 Nov 2007) | 2 lines
> > Changed paths:
> >    M /trunk/modules/access/file.c
> > 
> > oneliner to fix i_pos updating. works for me.
> 
> I think that's wrong. mmap() fetches <length> bytes
> starting from <offset>. Hence the new position has got
> to be offset + length, right?

Ah, youre right.

> Incrementing i_pos by length bytes will fail if,
> for any reasons, the original i_pos is not a multiple of
> the page size. This can happen if Seek() has been used, or
> if the file size has increased while we were reading it.

there's some problem with reading end of file, seems to be because
there's comparation agains offset+length > p_access->info.i_size so it
can leave last bits unread from that file. with little tweakin to
compare with p_access->info.i_pos + length instead and adjust length
with that, it seems to work more correctly. I added patch so you can
check that I didn't do any stupid assumptions on that one (again ;). 


-- 
Ilkka Ollakka
Xerox does it again and again and again and ...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vlc_access_file.diff
Type: text/x-patch
Size: 1285 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20071127/31658224/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20071127/31658224/attachment.sig>


More information about the vlc-devel mailing list