Commit 6ac2aafa authored by Renaud Dartus's avatar Renaud Dartus

* Fixed a segfault on exit under Windows 2000

parent 96e3c332
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions * Collection of useful common types and macros definitions
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * 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 <sam@via.ecp.fr> * Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr> * Vincent Seguin <seguin@via.ecp.fr>
...@@ -209,12 +209,8 @@ struct pgrm_descriptor_s; ...@@ -209,12 +209,8 @@ struct pgrm_descriptor_s;
# include <unistd.h> # include <unistd.h>
# define memalign(align,size) valloc(size) # define memalign(align,size) valloc(size)
# else # 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 */ /* Assume malloc alignment is sufficient */
# define memalign(align,size) malloc(size) # define memalign(align,size) malloc(size)
# endif
# endif # endif
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ac3_srfft_sse.c: accelerated SSE ac3 fft functions * ac3_srfft_sse.c: accelerated SSE ac3 fft functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * 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 <reno@videolan.org> * Authors: Renaud Dartus <reno@videolan.org>
* Aaron Holtzman <aholtzma@engr.uvic.ca> * Aaron Holtzman <aholtzma@engr.uvic.ca>
...@@ -200,7 +200,6 @@ static void fft_asmb_sse (int k, complex_t *x, complex_t *wTB, ...@@ -200,7 +200,6 @@ static void fft_asmb_sse (int k, complex_t *x, complex_t *wTB,
{ {
__asm__ __volatile__ ( __asm__ __volatile__ (
".align 16\n" ".align 16\n"
"pushl %%esp\n"
"pushl %%ebp\n" "pushl %%ebp\n"
"movl %%esp, %%ebp\n" "movl %%esp, %%ebp\n"
...@@ -345,7 +344,6 @@ static void fft_asmb_sse (int k, complex_t *x, complex_t *wTB, ...@@ -345,7 +344,6 @@ static void fft_asmb_sse (int k, complex_t *x, complex_t *wTB,
"addl $4, %%esp\n" "addl $4, %%esp\n"
"leave\n" "leave\n"
"popl %%esp\n"
: "=c" (k), "=a" (x), "=D" (wTB) : "=c" (k), "=a" (x), "=D" (wTB)
: "c" (k), "a" (x), "D" (wTB), "d" (d), "S" (d_3), "b" (C_1_sse) ); : "c" (k), "a" (x), "D" (wTB), "d" (d), "S" (d_3), "b" (C_1_sse) );
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ac3_decoder.h : ac3 decoder interface * ac3_decoder.h : ac3 decoder interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * 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 <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Renaud Dartus <reno@videolan.org> * Renaud Dartus <reno@videolan.org>
...@@ -355,6 +355,9 @@ typedef struct mantissa_s ...@@ -355,6 +355,9 @@ typedef struct mantissa_s
struct ac3dec_s struct ac3dec_s
{ {
float * samples; float * samples;
#if defined( __MINGW32__ )
float * samples_back;
#endif
imdct_t * imdct; imdct_t * imdct;
/* /*
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ac3_decoder_thread.c: ac3 decoder thread * ac3_decoder_thread.c: ac3 decoder thread
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * 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 <walken@zoy.org> * Authors: Michel Lespinasse <walken@zoy.org>
* *
...@@ -151,7 +151,12 @@ vlc_thread_t ac3dec_CreateThread( adec_config_t * p_config ) ...@@ -151,7 +151,12 @@ vlc_thread_t ac3dec_CreateThread( adec_config_t * p_config )
#undef IMDCT #undef IMDCT
/* Initialize the ac3 decoder structures */ /* 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)); 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->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->delay = memalign(16, 6 * 256 * sizeof(float));
p_ac3thread->ac3_decoder->imdct->delay1 = 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 ) ...@@ -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->delay1 );
free( p_ac3thread->ac3_decoder->imdct->delay ); free( p_ac3thread->ac3_decoder->imdct->delay );
free( p_ac3thread->ac3_decoder->imdct->buf ); free( p_ac3thread->ac3_decoder->imdct->buf );
#if defined( __MINGW32__ )
free( p_ac3thread->ac3_decoder->samples_back );
#else
free( p_ac3thread->ac3_decoder->samples ); free( p_ac3thread->ac3_decoder->samples );
#endif
free( p_ac3thread->ac3_decoder->imdct ); free( p_ac3thread->ac3_decoder->imdct );
free( p_ac3thread->ac3_decoder ); free( p_ac3thread->ac3_decoder );
free( p_ac3thread ); free( p_ac3thread );
...@@ -392,7 +401,11 @@ static void EndThread (ac3dec_thread_t * 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->delay1 );
free( p_ac3thread->ac3_decoder->imdct->delay ); free( p_ac3thread->ac3_decoder->imdct->delay );
free( p_ac3thread->ac3_decoder->imdct->buf ); free( p_ac3thread->ac3_decoder->imdct->buf );
#if defined( __MINGW32__ )
free( p_ac3thread->ac3_decoder->samples_back );
#else
free( p_ac3thread->ac3_decoder->samples ); free( p_ac3thread->ac3_decoder->samples );
#endif
free( p_ac3thread->ac3_decoder->imdct ); free( p_ac3thread->ac3_decoder->imdct );
free( p_ac3thread->ac3_decoder ); free( p_ac3thread->ac3_decoder );
free( p_ac3thread->p_config ); free( p_ac3thread->p_config );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment