diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2013-07-07 01:52:51 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2013-07-07 21:43:23 +0200 |
commit | 636ced8e1dc8248a1353b416240b93d70ad03edb (patch) | |
tree | 6a157f3eb215b97d50fd96ff43d7ae6581a7e9af /cmdutils.h | |
parent | 21732063a346475eb22c332b27e8216b79f9ad4a (diff) | |
download | ffmpeg-636ced8e1dc8248a1353b416240b93d70ad03edb.tar.gz |
cmdutils: wrap exit explicitly
Some C runtime implementations deadlock when calling threading functions
on the atexit() handler.
Use a simpler wrapper similar to av_log to call the cleanup function
before exit.
Bug-Id: 523
Diffstat (limited to 'cmdutils.h')
-rw-r--r-- | cmdutils.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cmdutils.h b/cmdutils.h index 2372b3f387..997ba1c750 100644 --- a/cmdutils.h +++ b/cmdutils.h @@ -45,6 +45,16 @@ extern struct SwsContext *sws_opts; extern AVDictionary *format_opts, *codec_opts, *resample_opts; /** + * Register a program-specific cleanup routine. + */ +void register_exit(void (*cb)(int ret)); + +/** + * Wraps exit with a program-specific cleanup routine. + */ +void exit_program(int ret); + +/** * Initialize the cmdutils option system, in particular * allocate the *_opts contexts. */ |