You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
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.
This commit is contained in:
@@ -149,9 +149,7 @@ static int write_fragment(const char *filename, AVIOContext *in)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if ((ret = avio_open2(&out, filename, AVIO_FLAG_WRITE, NULL, NULL)) < 0) {
|
if ((ret = avio_open2(&out, filename, AVIO_FLAG_WRITE, NULL, NULL)) < 0) {
|
||||||
char errbuf[100];
|
fprintf(stderr, "Unable to open %s: %s\n", filename, av_err2str(ret));
|
||||||
av_strerror(ret, errbuf, sizeof(errbuf));
|
|
||||||
fprintf(stderr, "Unable to open %s: %s\n", filename, errbuf);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
ret = copy_tag(in, out, MKBETAG('m', 'o', 'o', 'f'));
|
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;
|
AVFormatContext *ctx = NULL;
|
||||||
int err = 0, i, orig_tracks = tracks->nb_tracks;
|
int err = 0, i, orig_tracks = tracks->nb_tracks;
|
||||||
char errbuf[50], *ptr;
|
char *ptr;
|
||||||
struct Track *track;
|
struct Track *track;
|
||||||
|
|
||||||
err = avformat_open_input(&ctx, file, NULL, NULL);
|
err = avformat_open_input(&ctx, file, NULL, NULL);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
av_strerror(err, errbuf, sizeof(errbuf));
|
fprintf(stderr, "Unable to open %s: %s\n", file, av_err2str(err));
|
||||||
fprintf(stderr, "Unable to open %s: %s\n", file, errbuf);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = avformat_find_stream_info(ctx, NULL);
|
err = avformat_find_stream_info(ctx, NULL);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
av_strerror(err, errbuf, sizeof(errbuf));
|
fprintf(stderr, "Unable to identify %s: %s\n", file, av_err2str(err));
|
||||||
fprintf(stderr, "Unable to identify %s: %s\n", file, errbuf);
|
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user