mirror of
https://code.videolan.org/videolan/vlc
synced 2024-08-31 06:46:39 +02:00
* modules/audio_filter/converter/s16tofloat32swab.c:
added an #ifdef HAVE_ALLOCA.
This commit is contained in:
parent
58d2e71814
commit
171966e294
@ -3,7 +3,7 @@
|
|||||||
* with endianness change
|
* with endianness change
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 2002 VideoLAN
|
* Copyright (C) 2002 VideoLAN
|
||||||
* $Id: s16tofloat32swab.c,v 1.8 2002/11/20 16:43:32 sam Exp $
|
* $Id: s16tofloat32swab.c,v 1.9 2003/04/22 22:25:09 gbazin Exp $
|
||||||
*
|
*
|
||||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||||
* Henri Fallon <henri@videolan.org>
|
* Henri Fallon <henri@videolan.org>
|
||||||
@ -101,9 +101,15 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
|||||||
float * p_out = (float *)p_out_buf->p_buffer + i - 1;
|
float * p_out = (float *)p_out_buf->p_buffer + i - 1;
|
||||||
|
|
||||||
#ifdef HAVE_SWAB
|
#ifdef HAVE_SWAB
|
||||||
|
# ifdef HAVE_ALLOCA
|
||||||
s16 * p_swabbed = alloca( i * sizeof(s16) );
|
s16 * p_swabbed = alloca( i * sizeof(s16) );
|
||||||
|
# else
|
||||||
|
s16 * p_swabbed = malloc( i * sizeof(s16) );
|
||||||
|
# endif
|
||||||
|
|
||||||
swab( p_in_buf->p_buffer, (void *)p_swabbed, i * sizeof(s16) );
|
swab( p_in_buf->p_buffer, (void *)p_swabbed, i * sizeof(s16) );
|
||||||
p_in = p_swabbed + i - 1;
|
p_in = p_swabbed + i - 1;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
byte_t p_tmp[2];
|
byte_t p_tmp[2];
|
||||||
p_in = (s16 *)p_in_buf->p_buffer + i - 1;
|
p_in = (s16 *)p_in_buf->p_buffer + i - 1;
|
||||||
@ -121,6 +127,12 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
|||||||
p_in--; p_out--;
|
p_in--; p_out--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_SWAB
|
||||||
|
# ifndef HAVE_ALLOCA
|
||||||
|
free( p_swabbed );
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes * 2;
|
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes * 2;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user