History

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.

Marvin Scholz committed 1 year ago

Commit a903d6d1 parent b781f181 file · +4 −8Browse files

Unified · Split

tools/ismindex.c+4−8
@@ -149,9 +149,7 @@ static int write_fragment(const char *filename, AVIOContext *in) · 148 unmodified lines
149149 int ret;
150150
151151 if ((ret = avio_open2(&out, filename, AVIO_FLAG_WRITE, NULL, NULL)) < 0) {
152− char errbuf[100];
153− av_strerror(ret, errbuf, sizeof(errbuf));
154− fprintf(stderr, "Unable to open %s: %s\n", filename, errbuf);
152+ fprintf(stderr, "Unable to open %s: %s\n", filename, av_err2str(ret));
155153 return ret;
156154 }
157155 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, · 342 unmodified lines
500498 {
501499 AVFormatContext *ctx = NULL;
502500 int err = 0, i, orig_tracks = tracks->nb_tracks;
503− char errbuf[50], *ptr;
501+ char *ptr;
504502 struct Track *track;
505503
506504 err = avformat_open_input(&ctx, file, NULL, NULL);
507505 if (err < 0) {
508− av_strerror(err, errbuf, sizeof(errbuf));
509− fprintf(stderr, "Unable to open %s: %s\n", file, errbuf);
506+ fprintf(stderr, "Unable to open %s: %s\n", file, av_err2str(err));
510507 return 1;
511508 }
512509
513510 err = avformat_find_stream_info(ctx, NULL);
514511 if (err < 0) {
515− av_strerror(err, errbuf, sizeof(errbuf));
516− fprintf(stderr, "Unable to identify %s: %s\n", file, errbuf);
512+ fprintf(stderr, "Unable to identify %s: %s\n", file, av_err2str(err));
517513 goto fail;
518514 }
519515

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t