diff mbox series

[FFmpeg-devel,13/60] lavfi/f_metadata: use av_err2str to simplify code

Message ID D41CE2FHVZH4.1GTN3RIR92ZPC@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel,01/60] fftools/ffmpeg_opt: fix variable shadowing | expand

Commit Message

Marvin Scholz Sept. 8, 2024, 6:53 p.m. UTC
No need to explicitly specify the buffer here as it is only
ever passed to av_log, so av_err2str can be used.
---
 libavfilter/f_metadata.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Anton Khirnov Sept. 11, 2024, 11:57 a.m. UTC | #1
Quoting Marvin Scholz (2024-09-08 20:53:11)
> No need to explicitly specify the buffer here as it is only
> ever passed to av_log, so av_err2str can be used.
> ---
>  libavfilter/f_metadata.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

Looks very ok
diff mbox series

Patch

diff --git a/libavfilter/f_metadata.c b/libavfilter/f_metadata.c
index 1a72284790..abdfb1802b 100644
--- a/libavfilter/f_metadata.c
+++ b/libavfilter/f_metadata.c
@@ -276,10 +276,8 @@  static av_cold int init(AVFilterContext *ctx)
         }
 
         if (ret < 0) {
-            char buf[128];
-            av_strerror(ret, buf, sizeof(buf));
             av_log(ctx, AV_LOG_ERROR, "Could not open %s: %s\n",
-                   s->file_str, buf);
+                   s->file_str, av_err2str(ret));
             return ret;
         }