[vlc-devel] [PATCH v2 4/13] esout: refactor GetTmpFile()

Lyndon Brown jnqnfe at gmail.com
Wed Oct 7 03:14:01 CEST 2020


On Tue, 2020-10-06 at 23:40 +0300, Rémi Denis-Courmont wrote:
> Le tiistaina 6. lokakuuta 2020, 23.31.36 EEST Rémi Denis-Courmont a
> écrit :
> > How about *actually* factoring the admittedly repetitive code?
> > 
> > You can just call GetTempFile(filename, "/tmp"); and divide the
> > length of
> > the function in half. This does not need any external change.
> 
> And in fact, we really don't need a file name here at all, because we
> really 
> don't need two concurrent file handles to the same file.
> 
> Could just as well use tmpfile() which would be safe from leaking
> disk space.

I did make a little effort to trace the call stack of the function to
better understand its use when I made the change, but did not go all
the way with it.

If this is so, and no doubt you're right, then we should then consider
dropping patch #9 since this function is the only user of the extra
helper param that introduces.

I'll try to look again at the usage and adjust as you suggest.



More information about the vlc-devel mailing list