tests/tools/examples: Replace direct exit() calls by return.

This commit is contained in:
Diego Biurrun 2011-09-21 18:46:56 +02:00
parent be0675ce67
commit 9a5d6c23c5
5 changed files with 19 additions and 25 deletions

View file

@ -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;
}
}