[FFmpeg-devel] [PATCH] ffprobe: add support to '\b' and '\f' escaping in c_escape_str()
Stefano Sabatini
stefasab at gmail.com
Sun May 27 01:31:59 CEST 2012
---
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;
--
1.7.5.4
More information about the ffmpeg-devel
mailing list