[vlc-devel] Fixing reported length in a growing file

Rémi Denis-Courmont rem at videolan.org
Wed Apr 8 17:54:17 CEST 2009


Le mercredi 8 avril 2009, Bernat Foj Capell a écrit :
> I am writing a stream into a file and, some time after this starts, I
> start playing the file. However, there is one small problem to this,
> and is that the length of the file is not being updated. The position
> and time are correctly reported though, so I figure that it's not an
> impossible thing to do to update it, and that the problem is that
> length is just calculated or read when opening the file because it's
> not supposed to change.

VLC updates the file size with fstat() every 10 read operations.

> Since this is something I'd like to fix I have started looking into
> the code, and I found that maybe registering a callback to do it
> every time that position and time are also set would do the trick.

That would be horrible. The position is a float value, and may be 
updated extremely often.

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list