[FFmpeg-devel] [PATCH] ffprobe: prefer av_strtok_r() over av_get_token() for parsing print_fmt string
Stefano Sabatini
stefasab at gmail.com
Tue Oct 18 18:59:57 CEST 2011
On date Saturday 2011-10-15 19:18:43 +0200, Michael Niedermayer encoded:
> On Sat, Oct 15, 2011 at 12:50:49PM +0200, Stefano Sabatini wrote:
> > Simplify, and avoid the need for multiple levels of escaping.
> > ---
> > ffprobe.c | 12 ++++--------
> > 1 files changed, 4 insertions(+), 8 deletions(-)
> >
> > diff --git a/ffprobe.c b/ffprobe.c
> > index dfbb0ae..e78c9c5 100644
> > --- a/ffprobe.c
> > +++ b/ffprobe.c
> > @@ -1265,18 +1265,15 @@ static int probe_file(const char *filename)
> > AVFormatContext *fmt_ctx;
> > int ret;
> > Writer *w;
> > - const char *buf = print_format;
> > + char *buf0 = av_strdup(print_format), *buf;
> > char *w_str = NULL, *w_args = NULL;
> > WriterContext *wctx;
> >
> > writer_register_all();
> >
> > if (buf) {
>
> if(buf0) or print_format
>
> otherwise LGTM
Pushed a variant of this.
More information about the ffmpeg-devel
mailing list