Re: [FFmpeg-devel] AVWriter again (was: v2 1/2] avformat/url: check double dot is not to parent directory)

2020-08-04 Thread Nicolas George
Zhao Zhili (12020-07-31): > So we can get a writer with AVIO context as backend, with custom stream > filters. > It do sound interesting, as long as it doesn't go too far like io in Java and > C++. The maze of twisty little APIs all alike is one of the reasons I try to minimize my interactions

Re: [FFmpeg-devel] AVWriter again (was: v2 1/2] avformat/url: check double dot is not to parent directory)

2020-07-30 Thread Zhao Zhili
> On Jul 30, 2020, at 11:42 PM, Nicolas George wrote: > > zhilizhao (12020-07-28): >> fmemopen() can work with memory on stack or on heap, although it doesn’t >> support switch between the two dynamically. It’s a good to have feature like >> the small string optimization in std::string, but

Re: [FFmpeg-devel] AVWriter again (was: v2 1/2] avformat/url: check double dot is not to parent directory)

2020-07-30 Thread Nicolas George
zhilizhao (12020-07-28): > fmemopen() can work with memory on stack or on heap, although it doesn’t > support switch between the two dynamically. It’s a good to have feature like > the small string optimization in std::string, but i’m not too keen on it. I think it is an important optimization.

Re: [FFmpeg-devel] AVWriter again (was: v2 1/2] avformat/url: check double dot is not to parent directory)

2020-07-29 Thread Alexander Strasser
On 2020-07-28 20:43 +0800, zhilizhao wrote: > > On Jul 28, 2020, at 8:02 PM, Nicolas George wrote: > > > > zhilizhao (12020-07-28): > >> I think jb is referring to > >> > >> FILE *open_memstream(char **bufp, size_t *sizep); > >> https://linux.die.net/man/3/open_memstream > >>

Re: [FFmpeg-devel] AVWriter again (was: v2 1/2] avformat/url: check double dot is not to parent directory)

2020-07-28 Thread zhilizhao
> On Jul 28, 2020, at 8:02 PM, Nicolas George wrote: > > zhilizhao (12020-07-28): >> I think jb is referring to >> >> FILE *open_memstream(char **bufp, size_t *sizep); >> https://linux.die.net/man/3/open_memstream >> >> >> VLC has a wrapper

Re: [FFmpeg-devel] AVWriter again (was: v2 1/2] avformat/url: check double dot is not to parent directory)

2020-07-28 Thread Nicolas George
zhilizhao (12020-07-28): > I think jb is referring to > > FILE *open_memstream(char **bufp, size_t *sizep); > https://linux.die.net/man/3/open_memstream > > > VLC has a wrapper for it: > >

Re: [FFmpeg-devel] AVWriter again (was: v2 1/2] avformat/url: check double dot is not to parent directory)

2020-07-28 Thread zhilizhao
> On Jul 28, 2020, at 4:05 PM, Nicolas George wrote: > > Jean-Baptiste Kempf (12020-07-28): >> How is that different from open_memstream, which is done for this exact >> purpose? > > I am not sure what you are referring to, I do not find a function by > that name in FFmpeg. I think jb is

Re: [FFmpeg-devel] AVWriter again (was: v2 1/2] avformat/url: check double dot is not to parent directory)

2020-07-28 Thread Nicolas George
Jean-Baptiste Kempf (12020-07-28): > How is that different from open_memstream, which is done for this exact > purpose? I am not sure what you are referring to, I do not find a function by that name in FFmpeg. Are you referring to avio_open_dyn_buf()? If so, there are three differences: -

Re: [FFmpeg-devel] AVWriter again (was: v2 1/2] avformat/url: check double dot is not to parent directory)

2020-07-27 Thread Jean-Baptiste Kempf
On Sat, 25 Jul 2020, at 13:03, Nicolas George wrote: > And that's all. Everything is taken care of: the string will grow as > needed, the size will be tracked, error checks are made. Nothing to > worry about at all. How is that different from open_memstream, which is done for this exact

Re: [FFmpeg-devel] AVWriter again (was: v2 1/2] avformat/url: check double dot is not to parent directory)

2020-07-27 Thread Nicolas George
Marton Balint (12020-07-27): > If I understand correctly, you are speaking about URL handling in general > all over the codebase, and not only ff_make_absolute_url. I thought that was what you were speaking in the first place. ff_make_absolute_url() only does what the caller wants, the caller

Re: [FFmpeg-devel] AVWriter again (was: v2 1/2] avformat/url: check double dot is not to parent directory)

2020-07-27 Thread Nicolas George
Steven Liu (12020-07-27): > Because language barries. maybe I cannot deep understand, maybe need > more code examples. > But look interesting, maybe more easy for use. All right, here is a practical albeit fictional example. Let us say we want av_metadata_to_user_string() that turns an

Re: [FFmpeg-devel] AVWriter again (was: v2 1/2] avformat/url: check double dot is not to parent directory)

2020-07-27 Thread Marton Balint
On Sat, 25 Jul 2020, Nicolas George wrote: Marton Balint (12020-07-25): And I also would like to point out that using static strings with MAX_URL_SIZE is not OK. This function supports an arbitrary buffer size, so limiting it to MAX_URL_SIZE is a bug. Excellent point. That would require

Re: [FFmpeg-devel] AVWriter again (was: v2 1/2] avformat/url: check double dot is not to parent directory)

2020-07-27 Thread Steven Liu
Nicolas George 于2020年7月25日周六 下午7:03写道: > > Marton Balint (12020-07-25): > > And I also would like to point out that using static strings with > > MAX_URL_SIZE is not OK. This function supports an arbitrary buffer size, so > > limiting it to MAX_URL_SIZE is a bug. > > Excellent point. That would

[FFmpeg-devel] AVWriter again (was: v2 1/2] avformat/url: check double dot is not to parent directory)

2020-07-25 Thread Nicolas George
Marton Balint (12020-07-25): > And I also would like to point out that using static strings with > MAX_URL_SIZE is not OK. This function supports an arbitrary buffer size, so > limiting it to MAX_URL_SIZE is a bug. Excellent point. That would require changing the prototype of a few functions, but