diff mbox series

[FFmpeg-devel,2/2] avfilter/avfilter: Make ff_tlog_ref() static

Message ID AM7PR03MB66600B15D3B55D3941F1F6DE8FAC9@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit 2761a7403b5e905c7f9f70b4887ddfdab598dbcd
Headers show
Series [FFmpeg-devel,1/2] avfilter/avfilter: Remove unused buffer | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Oct. 2, 2021, 6:25 a.m. UTC
It allows compilers to inline the one and only call to this function
in its callers or even to optimize it away completely (this function
is empty in case TRACE is not defined).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/avfilter.c | 4 ++--
 libavfilter/internal.h | 2 --
 2 files changed, 2 insertions(+), 4 deletions(-)

Comments

Nicolas George Oct. 3, 2021, 5:29 p.m. UTC | #1
Andreas Rheinhardt (12021-10-02):
> It allows compilers to inline the one and only call to this function
> in its callers or even to optimize it away completely (this function
> is empty in case TRACE is not defined).
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavfilter/avfilter.c | 4 ++--
>  libavfilter/internal.h | 2 --
>  2 files changed, 2 insertions(+), 4 deletions(-)

LGTM to both.

Regards,
diff mbox series

Patch

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index d70db1b283..7362bcdab5 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -47,7 +47,7 @@ 
 #include "libavutil/ffversion.h"
 const char av_filter_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
 
-void ff_tlog_ref(void *ctx, AVFrame *ref, int end)
+static void tlog_ref(void *ctx, AVFrame *ref, int end)
 {
     ff_tlog(ctx,
             "ref[%p buf:%p data:%p linesize[%d, %d, %d, %d] pts:%"PRId64" pos:%"PRId64,
@@ -1018,7 +1018,7 @@  fail:
 int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
 {
     int ret;
-    FF_TPRINTF_START(NULL, filter_frame); ff_tlog_link(NULL, link, 1); ff_tlog(NULL, " "); ff_tlog_ref(NULL, frame, 1);
+    FF_TPRINTF_START(NULL, filter_frame); ff_tlog_link(NULL, link, 1); ff_tlog(NULL, " "); tlog_ref(NULL, frame, 1);
 
     /* Consistency checks */
     if (link->type == AVMEDIA_TYPE_VIDEO) {
diff --git a/libavfilter/internal.h b/libavfilter/internal.h
index e7c154aff0..116d5fcc96 100644
--- a/libavfilter/internal.h
+++ b/libavfilter/internal.h
@@ -230,8 +230,6 @@  void ff_command_queue_pop(AVFilterContext *filter);
 
 char *ff_get_ref_perms_string(char *buf, size_t buf_size, int perms);
 
-void ff_tlog_ref(void *ctx, AVFrame *ref, int end);
-
 void ff_tlog_link(void *ctx, AVFilterLink *link, int end);
 
 /**