OSDN Git Service

doc/examples/filtering: make use of av_err2str()
authorStefano Sabatini <stefasab@gmail.com>
Mon, 2 Dec 2013 12:08:00 +0000 (13:08 +0100)
committerStefano Sabatini <stefasab@gmail.com>
Mon, 2 Dec 2013 13:35:31 +0000 (14:35 +0100)
Simplify.

doc/examples/filtering_audio.c
doc/examples/filtering_video.c

index 8a3d91f..4081378 100644 (file)
@@ -254,9 +254,7 @@ end:
     av_frame_free(&filt_frame);
 
     if (ret < 0 && ret != AVERROR_EOF) {
-        char buf[1024];
-        av_strerror(ret, buf, sizeof(buf));
-        fprintf(stderr, "Error occurred: %s\n", buf);
+        fprintf(stderr, "Error occurred: %s\n", av_err2str(ret));
         exit(1);
     }
 
index 9c98814..c933320 100644 (file)
@@ -243,9 +243,7 @@ end:
     av_frame_free(&filt_frame);
 
     if (ret < 0 && ret != AVERROR_EOF) {
-        char buf[1024];
-        av_strerror(ret, buf, sizeof(buf));
-        fprintf(stderr, "Error occurred: %s\n", buf);
+        fprintf(stderr, "Error occurred: %s\n", av_err2str(ret));
         exit(1);
     }