[FFmpeg-devel] [PATCH] ffprobe: prefer av_strtok_r() over av_get_token() for parsing print_fmt string

Michael Niedermayer michaelni at gmx.at
Sat Oct 15 19:18:43 CEST 2011


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

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

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes
-------------- 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/20111015/159e0b5a/attachment.asc>


More information about the ffmpeg-devel mailing list