[FFmpeg-devel] [PATCH] ffprobe: add support to '\b' and '\f' escaping in c_escape_str()

Clément Bœsch ubitux at gmail.com
Sun May 27 09:52:14 CEST 2012


On Sun, May 27, 2012 at 01:31:59AM +0200, Stefano Sabatini wrote:
> ---
>  ffprobe.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/ffprobe.c b/ffprobe.c
> index c98bdac..1f3497b 100644
> --- a/ffprobe.c
> +++ b/ffprobe.c
> @@ -497,8 +497,8 @@ static const Writer default_writer = {
>  /* Compact output */
>  
>  /**
> - * Escape \n, \r, \\ and sep characters contained in s, and print the
> - * resulting string.
> + * Escape \n, \r, \f, \b, \\ and sep characters contained in s, and
> + * print the resulting string.
>   */
>  static const char *c_escape_str(AVBPrint *dst, const char *src, const char sep, void *log_ctx)
>  {
> @@ -506,6 +506,8 @@ static const char *c_escape_str(AVBPrint *dst, const char *src, const char sep,
>  
>      for (p = src; *p; p++) {
>          switch (*src) {
> +        case '\b': av_bprintf(dst, "%s", "\\b");  break;
> +        case '\f': av_bprintf(dst, "%s", "\\f");  break;
>          case '\n': av_bprintf(dst, "%s", "\\n");  break;
>          case '\r': av_bprintf(dst, "%s", "\\r");  break;
>          case '\\': av_bprintf(dst, "%s", "\\\\"); break;

LGTM, but I think the documentation requires an update.

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120527/7de54642/attachment.asc>


More information about the ffmpeg-devel mailing list