diff mbox series

[FFmpeg-devel,19/60] avdevice/jack: use av_err2str to simplify code

Message ID D41CE2FHWHZS.2PBD15XTC4Z1W@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, 7:45 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.
---
 libavdevice/jack.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Anton Khirnov Sept. 11, 2024, 12:04 p.m. UTC | #1
Quoting Marvin Scholz (2024-09-08 21:45:24)
> No need to explicitly specify the buffer here as it is only
> ever passed to av_log, so av_err2str can be used.
> ---
>  libavdevice/jack.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

LGTM
diff mbox series

Patch

diff --git a/libavdevice/jack.c b/libavdevice/jack.c
index d52bb06822..bb06971fe6 100644
--- a/libavdevice/jack.c
+++ b/libavdevice/jack.c
@@ -291,11 +291,9 @@  static int audio_read_packet(AVFormatContext *context, AVPacket *pkt)
             av_log(context, AV_LOG_ERROR,
                    "Input error: timed out when waiting for JACK process callback output\n");
         } else {
-            char errbuf[128];
             int ret = AVERROR(errno);
-            av_strerror(ret, errbuf, sizeof(errbuf));
             av_log(context, AV_LOG_ERROR, "Error while waiting for audio packet: %s\n",
-                   errbuf);
+                   av_err2str(ret));
         }
         if (!self->client)
             av_log(context, AV_LOG_ERROR, "Input error: JACK server is gone\n");