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

Bernat Foj Capell bfoj at gnuine.com
Thu Apr 9 09:06:28 CEST 2009


El dc 08 de 04 de 2009 a les 18:54 +0300, en/na Rémi Denis-Courmont va
escriure:
> 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.

Could you point me where in the code this is done? Since is not the
behaviour that I can observe. Length (which for your answer I guess is
calculated using file size) is never updated once a file is opened.

> 
> > 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.
> 

But position is currently being updated very often, isn't it? Sorry if I misunderstood what you said.
I'm going to try what you suggest in http://git.videolan.org/gitweb.cgi?p=vlc.git;a=commit;h=3b729128a6e2a0e0018c0f32bcd4ee611850b038 and see how well it works.




More information about the vlc-devel mailing list