From: Renaud Dartus Date: Wed, 31 Oct 2001 11:55:53 +0000 (+0000) Subject: * Fixed a segfault on exit under Windows 2000 X-Git-Tag: 0.2.91~45 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=6ac2aafab2a60557b25dc699648801c20c9c4b26;p=vlc * Fixed a segfault on exit under Windows 2000 --- diff --git a/include/common.h b/include/common.h index b34e824f39..ab36323d14 100644 --- a/include/common.h +++ b/include/common.h @@ -3,7 +3,7 @@ * Collection of useful common types and macros definitions ***************************************************************************** * Copyright (C) 1998, 1999, 2000 VideoLAN - * $Id: common.h,v 1.43 2001/10/30 19:34:53 reno Exp $ + * $Id: common.h,v 1.44 2001/10/31 11:55:53 reno Exp $ * * Authors: Samuel Hocevar * Vincent Seguin @@ -209,12 +209,8 @@ struct pgrm_descriptor_s; # include # define memalign(align,size) valloc(size) # else -# if defined( __MINGW32__ ) -# define memalign(align,size) (void *)(((unsigned long)(malloc(size+align-1))+align-1)&~(align-1)) -# else /* Assume malloc alignment is sufficient */ -# define memalign(align,size) malloc(size) -# endif +# define memalign(align,size) malloc(size) # endif diff --git a/plugins/imdct/ac3_srfft_sse.c b/plugins/imdct/ac3_srfft_sse.c index 29d6995495..e715e9e579 100644 --- a/plugins/imdct/ac3_srfft_sse.c +++ b/plugins/imdct/ac3_srfft_sse.c @@ -2,7 +2,7 @@ * ac3_srfft_sse.c: accelerated SSE ac3 fft functions ***************************************************************************** * Copyright (C) 1999, 2000, 2001 VideoLAN - * $Id: ac3_srfft_sse.c,v 1.6 2001/10/30 19:34:53 reno Exp $ + * $Id: ac3_srfft_sse.c,v 1.7 2001/10/31 11:55:53 reno Exp $ * * Authors: Renaud Dartus * Aaron Holtzman @@ -200,7 +200,6 @@ static void fft_asmb_sse (int k, complex_t *x, complex_t *wTB, { __asm__ __volatile__ ( ".align 16\n" - "pushl %%esp\n" "pushl %%ebp\n" "movl %%esp, %%ebp\n" @@ -345,7 +344,6 @@ static void fft_asmb_sse (int k, complex_t *x, complex_t *wTB, "addl $4, %%esp\n" "leave\n" - "popl %%esp\n" : "=c" (k), "=a" (x), "=D" (wTB) : "c" (k), "a" (x), "D" (wTB), "d" (d), "S" (d_3), "b" (C_1_sse) ); } diff --git a/src/ac3_decoder/ac3_decoder.h b/src/ac3_decoder/ac3_decoder.h index 71882df09b..c6740bc519 100644 --- a/src/ac3_decoder/ac3_decoder.h +++ b/src/ac3_decoder/ac3_decoder.h @@ -2,7 +2,7 @@ * ac3_decoder.h : ac3 decoder interface ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: ac3_decoder.h,v 1.12 2001/10/30 19:34:53 reno Exp $ + * $Id: ac3_decoder.h,v 1.13 2001/10/31 11:55:53 reno Exp $ * * Authors: Michel Kaempf * Renaud Dartus @@ -355,6 +355,9 @@ typedef struct mantissa_s struct ac3dec_s { float * samples; +#if defined( __MINGW32__ ) + float * samples_back; +#endif imdct_t * imdct; /* diff --git a/src/ac3_decoder/ac3_decoder_thread.c b/src/ac3_decoder/ac3_decoder_thread.c index 13d9bd08da..667d83ed6c 100644 --- a/src/ac3_decoder/ac3_decoder_thread.c +++ b/src/ac3_decoder/ac3_decoder_thread.c @@ -2,7 +2,7 @@ * ac3_decoder_thread.c: ac3 decoder thread ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: ac3_decoder_thread.c,v 1.38 2001/10/30 19:34:53 reno Exp $ + * $Id: ac3_decoder_thread.c,v 1.39 2001/10/31 11:55:53 reno Exp $ * * Authors: Michel Lespinasse * @@ -151,7 +151,12 @@ vlc_thread_t ac3dec_CreateThread( adec_config_t * p_config ) #undef IMDCT /* Initialize the ac3 decoder structures */ +#if defined( __MINGW32__ ) + p_ac3thread->ac3_decoder->samples_back = memalign(16, 6 * 256 * sizeof(float) + 15); + p_ac3thread->ac3_decoder->samples = (float *) (((unsigned long) p_ac3thread->ac3_decoder->samples_back+15) & ~0xFUL); +#else p_ac3thread->ac3_decoder->samples = memalign(16, 6 * 256 * sizeof(float)); +#endif p_ac3thread->ac3_decoder->imdct->buf = memalign(16, N/4 * sizeof(complex_t)); p_ac3thread->ac3_decoder->imdct->delay = memalign(16, 6 * 256 * sizeof(float)); p_ac3thread->ac3_decoder->imdct->delay1 = memalign(16, 6 * 256 * sizeof(float)); @@ -197,7 +202,11 @@ vlc_thread_t ac3dec_CreateThread( adec_config_t * p_config ) free( p_ac3thread->ac3_decoder->imdct->delay1 ); free( p_ac3thread->ac3_decoder->imdct->delay ); free( p_ac3thread->ac3_decoder->imdct->buf ); +#if defined( __MINGW32__ ) + free( p_ac3thread->ac3_decoder->samples_back ); +#else free( p_ac3thread->ac3_decoder->samples ); +#endif free( p_ac3thread->ac3_decoder->imdct ); free( p_ac3thread->ac3_decoder ); free( p_ac3thread ); @@ -392,7 +401,11 @@ static void EndThread (ac3dec_thread_t * p_ac3thread) free( p_ac3thread->ac3_decoder->imdct->delay1 ); free( p_ac3thread->ac3_decoder->imdct->delay ); free( p_ac3thread->ac3_decoder->imdct->buf ); +#if defined( __MINGW32__ ) + free( p_ac3thread->ac3_decoder->samples_back ); +#else free( p_ac3thread->ac3_decoder->samples ); +#endif free( p_ac3thread->ac3_decoder->imdct ); free( p_ac3thread->ac3_decoder ); free( p_ac3thread->p_config );