[vlc-devel] [PATCH] sout: file: truncate path if too long

Thomas Guillem thomas at gllm.fr
Tue Dec 17 11:21:31 CET 2019

On Mon, Dec 16, 2019, at 17:18, Rémi Denis-Courmont wrote:
> Le maanantaina 16. joulukuuta 2019, 16.57.59 EET Thomas Guillem a écrit :
> > This fixes sout chain fail when the input path/url was too long. This can
> > easily happen when the source is a network url that can be longer than local
> > pathes.
> On one hand, I doubt that the ENAMETOOLONG is generally reliably returned, and 
> NAME_MAX is definitely not reliable either. On the other hand, again, software 
> must not change an explicitly provided filename - and lets not even get into 
> consistency issues, as it's far from the only place that "suffers" from this 
> "problem", which really is a feature.

ENAMETOOLONG seems to work fine on Linux. Need to be tested on WIndows too.

> And as François noted already, the end of the file name is probably the worst 
> possible part to cut off, as that's typically the discriminant in a series.
> It looks to me that this belongs where filename_sanitize() is used, not in the 
> stream output.

In that case, should we force a maximum length for every files written by VLC ?

One other way to fix my issue is to remove the URL option (it's generally the longest part of the URL), but we can loose some crucial infos in that case too.

> -- 
> 雷米‧德尼-库尔蒙
> http://www.remlab.net/
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

More information about the vlc-devel mailing list