summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarm van der Heijden <hrm@users.sourceforge.net>2001-11-03 23:02:43 +0000
committerHarm van der Heijden <hrm@users.sourceforge.net>2001-11-03 23:02:43 +0000
commit3ee3249d27bb9ce44e69b450acfd9f2c8c4eb7be (patch)
treefe59d2a43ade72dab7d4cd9355d641ef232c5a01
parenteb6dba105731eed090ff190e3a2142852ec83932 (diff)
downloadxine-lib-3ee3249d27bb9ce44e69b450acfd9f2c8c4eb7be.tar.gz
xine-lib-3ee3249d27bb9ce44e69b450acfd9f2c8c4eb7be.tar.bz2
- minor change; restore old signal handler instead of default. This in
case xine-engine starts implementing its own SIGSEGV handler. (which it should IMHO :-). CVS patchset: 944 CVS date: 2001/11/03 23:02:43
-rw-r--r--src/libdivx4/xine_decoder.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/libdivx4/xine_decoder.c b/src/libdivx4/xine_decoder.c
index 8d6daa3ed..9267c10ad 100644
--- a/src/libdivx4/xine_decoder.c
+++ b/src/libdivx4/xine_decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_decoder.c,v 1.7 2001/11/03 22:28:05 hrm Exp $
+ * $Id: xine_decoder.c,v 1.8 2001/11/03 23:02:43 hrm Exp $
*
* xine decoder plugin using divx4
*
@@ -61,6 +61,9 @@
#if CATCH_SIGSEGV
#include <signal.h>
+/* to be able to restore the old handler */
+void (*old_handler)(int);
+
void catch_sigsegv(int sig)
{
printf("divx4: caught SIGSEGV, caused by libdivxdecore.\n"
@@ -406,12 +409,14 @@ video_decoder_t *init_video_decoder_plugin (int iface_version, config_values_t *
* old versions of OpenDivx are known to do this.
* we have to exit(1) in case it happens, but at least the user'll know
* what happened */
- if (signal(SIGSEGV, catch_sigsegv) == SIG_ERR)
+ old_handler = signal(SIGSEGV, catch_sigsegv);
+ if (old_handler == SIG_ERR)
printf("divx4: failed to set SIGSEGV handler for libdivxdecore version check. Danger!\n");
/* ask decore for version, using arbitrary handle 123 */
version = libdecore_func(123, DEC_OPT_VERSION, 0, 0);
- /* reset signal handler */
- signal(SIGSEGV, SIG_DFL);
+ /* restore old signal handler */
+ if (old_handler != SIG_ERR)
+ signal(SIGSEGV, old_handler);
#else
/* no SIGSEGV catching, let's hope survive this... */
version = libdecore_func(123, DEC_OPT_VERSION, 0, 0);