summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2011-09-21 18:46:56 +0200
committerDiego Biurrun <diego@biurrun.de>2011-12-08 01:00:58 +0100
commit9a5d6c23c5cc25b887f996d55f96dfbacf760e88 (patch)
tree78a4bad898880ef2a740306908204a008980a581 /libavformat
parentbe0675ce672b7788b0f1277704be663f415d6498 (diff)
tests/tools/examples: Replace direct exit() calls by return.
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/output-example.c10
-rw-r--r--libavformat/seek-test.c7
2 files changed, 8 insertions, 9 deletions
diff --git a/libavformat/output-example.c b/libavformat/output-example.c
index 95690f75de..809e236674 100644
--- a/libavformat/output-example.c
+++ b/libavformat/output-example.c
@@ -445,7 +445,7 @@ int main(int argc, char **argv)
"The output format is automatically guessed according to the file extension.\n"
"Raw images can also be output by using '%%d' in the filename\n"
"\n", argv[0]);
- exit(1);
+ return 1;
}
filename = argv[1];
@@ -459,14 +459,14 @@ int main(int argc, char **argv)
}
if (!fmt) {
fprintf(stderr, "Could not find suitable output format\n");
- exit(1);
+ return 1;
}
/* allocate the output media context */
oc = avformat_alloc_context();
if (!oc) {
fprintf(stderr, "Memory error\n");
- exit(1);
+ return 1;
}
oc->oformat = fmt;
snprintf(oc->filename, sizeof(oc->filename), "%s", filename);
@@ -486,7 +486,7 @@ int main(int argc, char **argv)
parameters). */
if (av_set_parameters(oc, NULL) < 0) {
fprintf(stderr, "Invalid output format parameters\n");
- exit(1);
+ return 1;
}
av_dump_format(oc, 0, filename, 1);
@@ -502,7 +502,7 @@ int main(int argc, char **argv)
if (!(fmt->flags & AVFMT_NOFILE)) {
if (avio_open(&oc->pb, filename, AVIO_FLAG_WRITE) < 0) {
fprintf(stderr, "Could not open '%s'\n", filename);
- exit(1);
+ return 1;
}
}
diff --git a/libavformat/seek-test.c b/libavformat/seek-test.c
index 363be8a88b..43dee56fe7 100644
--- a/libavformat/seek-test.c
+++ b/libavformat/seek-test.c
@@ -28,7 +28,6 @@
#include "libavutil/mathematics.h"
#include "libavformat/avformat.h"
-#undef exit
#undef printf
#undef fprintf
@@ -75,7 +74,7 @@ int main(int argc, char **argv)
if (argc != 2) {
printf("usage: %s input_file\n"
"\n", argv[0]);
- exit(1);
+ return 1;
}
filename = argv[1];
@@ -84,13 +83,13 @@ int main(int argc, char **argv)
av_dict_free(&format_opts);
if (ret < 0) {
fprintf(stderr, "cannot open %s\n", filename);
- exit(1);
+ return 1;
}
ret = avformat_find_stream_info(ic, NULL);
if (ret < 0) {
fprintf(stderr, "%s: could not find codec parameters\n", filename);
- exit(1);
+ return 1;
}
for(i=0; ; i++){