[FFmpeg-devel] [PATCH 1/2] avutil: add av_fopen_utf8()

Michael Niedermayer michaelni at gmx.at
Sat Nov 2 01:18:29 CET 2013


On Fri, Nov 01, 2013 at 10:19:35AM +0100, Stefano Sabatini wrote:
> On date Friday 2013-11-01 02:06:36 +0100, Michael Niedermayer encoded:
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> >  libavutil/avutil.h    |    6 ++++++
> >  libavutil/file_open.c |   30 ++++++++++++++++++++++++++++++
> >  2 files changed, 36 insertions(+)
> > 
> > diff --git a/libavutil/avutil.h b/libavutil/avutil.h
> > index 4692c00..7bd76d1 100644
> > --- a/libavutil/avutil.h
> > +++ b/libavutil/avutil.h
> > @@ -313,6 +313,12 @@ unsigned av_int_list_length_for_size(unsigned elsize,
> >      av_int_list_length_for_size(sizeof(*(list)), list, term)
> >  
> >  /**
> > + * Open a file using a utf8 filename
> > + */
> >
> 
> Open a file using a UTF-8 filename.
> 
> +FILE *av_fopen_utf8(const char *path, const char *mode);
> 
> > +
> > +
> > +/**
> >   * @}
> >   * @}
> >   */
> > diff --git a/libavutil/file_open.c b/libavutil/file_open.c
> > index 389076f..76b0852 100644
> > --- a/libavutil/file_open.c
> > +++ b/libavutil/file_open.c
> > @@ -93,3 +93,33 @@ int avpriv_open(const char *filename, int flags, ...)
> >  
> >      return fd;
> >  }
> > +
> > +FILE *av_fopen_utf8(const char *path, const char *mode)
> 
> What about returning an error code in order to provide some feedback
> to the user? This is especially relevant since such function can fail
> in multiple interesting ways.
> 

> int av_fopen_utf8(FILE **fp, const char *path, const char *mode)

fopen() has a well known API, and that is not it

will submit a new patch

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131102/79b526eb/attachment.asc>


More information about the ffmpeg-devel mailing list