diff mbox series

[FFmpeg-devel,08/60] lavfi/vf_vmafmotion: use av_err2str to simplify code

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

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Marvin Scholz Sept. 8, 2024, 6:02 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/vf_vmafmotion.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

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

Possibly ok
diff mbox series

Patch

diff --git a/libavfilter/vf_vmafmotion.c b/libavfilter/vf_vmafmotion.c
index 7bc73416e8..f9315e56b6 100644
--- a/libavfilter/vf_vmafmotion.c
+++ b/libavfilter/vf_vmafmotion.c
@@ -318,10 +318,8 @@  static av_cold int init(AVFilterContext *ctx)
             s->stats_file = avpriv_fopen_utf8(s->stats_file_str, "w");
             if (!s->stats_file) {
                 int err = AVERROR(errno);
-                char buf[128];
-                av_strerror(err, buf, sizeof(buf));
                 av_log(ctx, AV_LOG_ERROR, "Could not open stats file %s: %s\n",
-                       s->stats_file_str, buf);
+                       s->stats_file_str, av_err2str(err));
                 return err;
             }
         }