ffmpeg | branch: master | Marvin Scholz <epira...@gmail.com> | Wed Apr  2 
01:37:34 2025 +0200| [a903d6dade3d3623efd2d03a63a00a17d5525631] | committer: 
Marvin Scholz

tools/ismindex: use av_err2str

There is no need to explicitly specify the buffer, as it
is only ever passed to fprintf, so av_err2str can be used.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a903d6dade3d3623efd2d03a63a00a17d5525631
---

 tools/ismindex.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/tools/ismindex.c b/tools/ismindex.c
index 6fe68d8a79..b110420bf0 100644
--- a/tools/ismindex.c
+++ b/tools/ismindex.c
@@ -149,9 +149,7 @@ static int write_fragment(const char *filename, AVIOContext 
*in)
     int ret;
 
     if ((ret = avio_open2(&out, filename, AVIO_FLAG_WRITE, NULL, NULL)) < 0) {
-        char errbuf[100];
-        av_strerror(ret, errbuf, sizeof(errbuf));
-        fprintf(stderr, "Unable to open %s: %s\n", filename, errbuf);
+        fprintf(stderr, "Unable to open %s: %s\n", filename, av_err2str(ret));
         return ret;
     }
     ret = copy_tag(in, out, MKBETAG('m', 'o', 'o', 'f'));
@@ -500,20 +498,18 @@ static int handle_file(struct Tracks *tracks, const char 
*file, int split,
 {
     AVFormatContext *ctx = NULL;
     int err = 0, i, orig_tracks = tracks->nb_tracks;
-    char errbuf[50], *ptr;
+    char *ptr;
     struct Track *track;
 
     err = avformat_open_input(&ctx, file, NULL, NULL);
     if (err < 0) {
-        av_strerror(err, errbuf, sizeof(errbuf));
-        fprintf(stderr, "Unable to open %s: %s\n", file, errbuf);
+        fprintf(stderr, "Unable to open %s: %s\n", file, av_err2str(err));
         return 1;
     }
 
     err = avformat_find_stream_info(ctx, NULL);
     if (err < 0) {
-        av_strerror(err, errbuf, sizeof(errbuf));
-        fprintf(stderr, "Unable to identify %s: %s\n", file, errbuf);
+        fprintf(stderr, "Unable to identify %s: %s\n", file, av_err2str(err));
         goto fail;
     }
 

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to