aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorRamiro Polla <ramiro.polla@gmail.com>2007-09-16 18:08:51 +0000
committerRamiro Polla <ramiro.polla@gmail.com>2007-09-16 18:08:51 +0000
commitf71163d7915a75e75b7ebb3b78e6fb1013327d37 (patch)
tree2093d8f2cb5acd23ca47c018effc990ebf681893 /ffmpeg.c
parent47f93b61e8069347043ad5dca93a2c32cd4daa0c (diff)
downloadffmpeg-f71163d7915a75e75b7ebb3b78e6fb1013327d37.tar.gz
Move av_exit() to before main()
Originally committed as revision 10510 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c90
1 files changed, 44 insertions, 46 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 1fdfaa1c35..905c3427f7 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3789,52 +3789,6 @@ static void show_help(void)
av_opt_show(sws_opts, NULL);
}
-static int av_exit();
-
-int main(int argc, char **argv)
-{
- int i;
- int64_t ti;
-
- av_register_all();
-
- for(i=0; i<CODEC_TYPE_NB; i++){
- avctx_opts[i]= avcodec_alloc_context2(i);
- }
- avformat_opts = av_alloc_format_context();
- sws_opts = sws_getContext(16,16,0, 16,16,0, sws_flags, NULL,NULL,NULL);
-
- show_banner();
- if (argc <= 1) {
- show_help();
- exit(1);
- }
-
- /* parse options */
- parse_options(argc, argv, options, opt_output_file);
-
- /* file converter / grab */
- if (nb_output_files <= 0) {
- fprintf(stderr, "Must supply at least one output file\n");
- exit(1);
- }
-
- if (nb_input_files == 0) {
- fprintf(stderr, "Must supply at least one input file\n");
- exit(1);
- }
-
- ti = getutime();
- av_encode(output_files, nb_output_files, input_files, nb_input_files,
- stream_maps, nb_stream_maps);
- ti = getutime() - ti;
- if (do_benchmark) {
- printf("bench: utime=%0.3fs\n", ti / 1000000.0);
- }
-
- return av_exit();
-}
-
static int av_exit()
{
int i;
@@ -3887,3 +3841,47 @@ static int av_exit()
exit(0); /* not all OS-es handle main() return value */
return 0;
}
+
+int main(int argc, char **argv)
+{
+ int i;
+ int64_t ti;
+
+ av_register_all();
+
+ for(i=0; i<CODEC_TYPE_NB; i++){
+ avctx_opts[i]= avcodec_alloc_context2(i);
+ }
+ avformat_opts = av_alloc_format_context();
+ sws_opts = sws_getContext(16,16,0, 16,16,0, sws_flags, NULL,NULL,NULL);
+
+ show_banner();
+ if (argc <= 1) {
+ show_help();
+ exit(1);
+ }
+
+ /* parse options */
+ parse_options(argc, argv, options, opt_output_file);
+
+ /* file converter / grab */
+ if (nb_output_files <= 0) {
+ fprintf(stderr, "Must supply at least one output file\n");
+ exit(1);
+ }
+
+ if (nb_input_files == 0) {
+ fprintf(stderr, "Must supply at least one input file\n");
+ exit(1);
+ }
+
+ ti = getutime();
+ av_encode(output_files, nb_output_files, input_files, nb_input_files,
+ stream_maps, nb_stream_maps);
+ ti = getutime() - ti;
+ if (do_benchmark) {
+ printf("bench: utime=%0.3fs\n", ti / 1000000.0);
+ }
+
+ return av_exit();
+}