Advertisement
Guest User

Untitled

a guest
Feb 24th, 2013
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. diff --git a/ffmpeg.c b/ffmpeg.c
  2. index 6c3994f..f732d52 100644
  3. --- a/ffmpeg.c
  4. +++ b/ffmpeg.c
  5. @@ -3259,12 +3259,18 @@ static void log_callback_null(void *ptr, int level, const char *fmt, va_list vl)
  6. {
  7. }
  8.  
  9. +static void do_exit(int status)
  10. +{
  11. + exit_program();
  12. + exit(status);
  13. +}
  14. +
  15. int main(int argc, char **argv)
  16. {
  17. int ret;
  18. int64_t ti;
  19.  
  20. - atexit(exit_program);
  21. + //atexit(exit_program);
  22.  
  23. setvbuf(stderr,NULL,_IONBF,0); /* win32 runtime needs this */
  24.  
  25. @@ -3293,34 +3299,34 @@ int main(int argc, char **argv)
  26. /* parse options and open all input/output files */
  27. ret = ffmpeg_parse_options(argc, argv);
  28. if (ret < 0)
  29. - exit(1);
  30. + do_exit(1);
  31.  
  32. if (nb_output_files <= 0 && nb_input_files == 0) {
  33. show_usage();
  34. av_log(NULL, AV_LOG_WARNING, "Use -h to get full help or, even better, run 'man %s'\n", program_name);
  35. - exit(1);
  36. + do_exit(1);
  37. }
  38.  
  39. /* file converter / grab */
  40. if (nb_output_files <= 0) {
  41. av_log(NULL, AV_LOG_FATAL, "At least one output file must be specified\n");
  42. - exit(1);
  43. + do_exit(1);
  44. }
  45.  
  46. // if (nb_input_files == 0) {
  47. // av_log(NULL, AV_LOG_FATAL, "At least one input file must be specified\n");
  48. -// exit(1);
  49. +// do_exit(1);
  50. // }
  51.  
  52. current_time = ti = getutime();
  53. if (transcode() < 0)
  54. - exit(1);
  55. + do_exit(1);
  56. ti = getutime() - ti;
  57. if (do_benchmark) {
  58. int maxrss = getmaxrss() / 1024;
  59. printf("bench: utime=%0.3fs maxrss=%ikB\n", ti / 1000000.0, maxrss);
  60. }
  61.  
  62. - exit(received_nb_signals ? 255 : 0);
  63. + do_exit(received_nb_signals ? 255 : 0);
  64. return 0;
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement