[FFmpeg-devel] [PATCH v11 2/3] fftools: add mem log flag for printing memory addresses

softworkz ffmpegagent at gmail.com
Fri Jun 6 23:29:29 EEST 2025


From: softworkz <softworkz at hotmail.com>

This commit adds the mem log flag.
When specifying this flag at the command line, context prefixes will
be printed with memory addresses like in earlier ffmpeg versions.

Example with mem flag:

[hevc @ 0000018e72a89cc0] .....

without (new behavior):

[hevc] .....

Signed-off-by: softworkz <softworkz at hotmail.com>
---
 fftools/opt_common.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/fftools/opt_common.c b/fftools/opt_common.c
index c2f6b9de2a..e4afef7707 100644
--- a/fftools/opt_common.c
+++ b/fftools/opt_common.c
@@ -1301,6 +1301,12 @@ int opt_loglevel(void *optctx, const char *opt, const char *arg)
             } else {
                 flags |= AV_LOG_PRINT_DATETIME;
             }
+        } else if (av_strstart(token, "mem", &arg)) {
+            if (cmd == '-') {
+                flags &= ~AV_LOG_PRINT_MEMADDRESS;
+            } else {
+                flags |= AV_LOG_PRINT_MEMADDRESS;
+            }
         } else {
             break;
         }
@@ -1332,6 +1338,7 @@ int opt_loglevel(void *optctx, const char *opt, const char *arg)
         av_log(NULL, AV_LOG_FATAL, "\"level\"\n");
         av_log(NULL, AV_LOG_FATAL, "\"time\"\n");
         av_log(NULL, AV_LOG_FATAL, "\"datetime\"\n");
+        av_log(NULL, AV_LOG_FATAL, "\"mem\"\n");
         return AVERROR(EINVAL);
     }
 
-- 
ffmpeg-codebot



More information about the ffmpeg-devel mailing list