[FFmpeg-devel] [PATCH 4/6] lavu/avstring: add av_append_path_component() funcion

Lukasz Marek lukasz.m.luki2 at gmail.com
Tue Jul 8 12:57:04 CEST 2014


On 7 July 2014 23:46, wm4 <nfxjfg at googlemail.com> wrote:

> On Mon, 07 Jul 2014 22:48:12 +0200
> Lukasz Marek <lukasz.m.luki2 at gmail.com> wrote:
>
> > On 05.07.2014 18:52, wm4 wrote:
> > > On Sat,  5 Jul 2014 18:12:02 +0200
> > > Lukasz Marek <lukasz.m.luki2 at gmail.com> wrote:
> > >
> > >> TODO: bump minor, update doc/APIchanges
> > >>
> > >> Convinient function to build paths.
> > >>
> > >> Signed-off-by: Lukasz Marek <lukasz.m.luki2 at gmail.com>
> > >> ---
> > >>   libavutil/avstring.c | 43
> +++++++++++++++++++++++++++++++++++++++++++
> > >>   libavutil/avstring.h | 10 ++++++++++
> > >>   2 files changed, 53 insertions(+)
> > >> +/**
> > >> + * Append path component to the existing path.
> > >> + * Path separator '/' is placed between when needed.
> > >> + * Resulting string have to be freed with av_free().
> > >> + * @param path      base path
> > >> + * @param component component to be appended
> > >> + * @return new path or NULL on error.
> > >> + */
> > >> +char *av_append_path_component(const char *path, const char
> *component);
> > >
> > > IMO the name is awkward. Maybe av_path_join()?
> > >
> > > Did you have a look at Python's os.path.join()? IMO it has pretty good
> > > and well documented semantics, which you could steal.
> >
> > I had look at it after your comment. I don't know it is better. It seems
> > a bit complicated for a simple needs of ffmpeg.
>
> If it's just meant to be extremely simple, it's probably better to
> leave it private to this code, instead of pretending it's generic
> enough to belong into libavutil. (Just my opinion.)


Yes. I thought about that too, especially when you suggest to not
reallocate fullpath for every entry.
So i drop this one.
I will resend listing dir in file:// protocol later.


More information about the ffmpeg-devel mailing list