summaryrefslogtreecommitdiff
path: root/src/liba52
diff options
context:
space:
mode:
Diffstat (limited to 'src/liba52')
-rw-r--r--src/liba52/parse.c11
-rw-r--r--src/liba52/xine_decoder.c10
2 files changed, 10 insertions, 11 deletions
diff --git a/src/liba52/parse.c b/src/liba52/parse.c
index 7a361e375..e92474761 100644
--- a/src/liba52/parse.c
+++ b/src/liba52/parse.c
@@ -29,14 +29,7 @@
#include "a52_internal.h"
#include "bitstream.h"
#include "tables.h"
-
-#ifdef HAVE_MEMALIGN
-/* some systems have memalign() but no declaration for it */
-void * memalign (size_t align, size_t size);
-#else
-/* assume malloc alignment is sufficient */
-#define memalign(align,size) malloc (size)
-#endif
+#include "xineutils.h"
static sample_t q_1[2];
static sample_t q_2[2];
@@ -54,7 +47,7 @@ sample_t * a52_init (uint32_t mm_accel)
imdct_init (mm_accel);
- samples = memalign (16, 256 * 12 * sizeof (sample_t));
+ samples = xine_xmalloc_aligned (16, 256 * 12 * sizeof (sample_t));
if (samples == NULL)
return NULL;
diff --git a/src/liba52/xine_decoder.c b/src/liba52/xine_decoder.c
index ffad6f2f6..a9b4f5b75 100644
--- a/src/liba52/xine_decoder.c
+++ b/src/liba52/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.9 2001/11/17 14:26:38 f1rmb Exp $
+ * $Id: xine_decoder.c,v 1.10 2001/11/17 22:40:01 miguelfreitas Exp $
*
* stuff needed to turn liba52 into a xine decoder plugin
*/
@@ -95,7 +95,8 @@ void a52dec_init (audio_decoder_t *this_gen, ao_instance_t *audio_out) {
this->pts = 0;
this->last_pts = 0;
- this->samples = a52_init (xine_mm_accel());
+ if( !this->samples )
+ this->samples = a52_init (xine_mm_accel());
/*
* find out if this driver supports a52 output
@@ -454,6 +455,11 @@ void a52dec_close (audio_decoder_t *this_gen) {
if (this->output_open)
this->audio_out->close (this->audio_out);
+ if( this->samples ) {
+ xine_free_aligned( this->samples );
+ this->samples = NULL;
+ }
+
this->output_open = 0;
#ifdef DEBUG_A52