From 3999004c72e12aa3f718ae08c1fec5d50753af65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Wed, 12 Dec 2007 12:31:03 +0100 Subject: Remove use of xine_xmalloc_aligned() in libxine, and link it to libavutil. --- src/xine-engine/Makefile.am | 8 +++++--- src/xine-engine/buffer.c | 16 +++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/xine-engine/Makefile.am b/src/xine-engine/Makefile.am index 36c48a3c9..f803cdf2f 100644 --- a/src/xine-engine/Makefile.am +++ b/src/xine-engine/Makefile.am @@ -1,7 +1,8 @@ include $(top_srcdir)/misc/Makefile.common include $(top_srcdir)/lib/Makefile.common -AM_CFLAGS = $(DEFAULT_OCFLAGS) $(X_CFLAGS) $(FT2_CFLAGS) $(FONTCONFIG_CFLAGS) $(VISIBILITY_FLAG) +AM_CFLAGS = $(DEFAULT_OCFLAGS) $(X_CFLAGS) $(FT2_CFLAGS) $(FONTCONFIG_CFLAGS) \ + $(AVUTIL_CFLAGS) $(VISIBILITY_FLAG) AM_CPPFLAGS = $(XDG_BASEDIR_CPPFLAGS) $(ZLIB_CPPFLAGS) -DXINE_LIBRARY_COMPILE XINEUTILS_LIB = $(top_builddir)/src/xine-utils/libxineutils.la @@ -32,11 +33,12 @@ libxine_la_SOURCES = xine.c metronom.c configfile.c buffer.c \ input_rip.c input_cache.c info_helper.c refcounter.c \ alphablend.c -libxine_la_DEPENDENCIES = $(XINEUTILS_LIB) $(XDG_BASEDIR_DEPS) \ +libxine_la_DEPENDENCIES = $(XINEUTILS_LIB) $(XDG_BASEDIR_DEPS) $(AVUTIL_DEPS) \ $(pthread_dep) $(LIBXINEPOSIX) libxine_la_LIBADD = $(PTHREAD_LIBS) $(DYNAMIC_LD_LIBS) $(LTLIBINTL) $(ZLIB_LIBS) \ -lm $(XINEUTILS_LIB) $(LTLIBICONV) $(FT2_LIBS) $(FONTCONFIG_LIBS) \ - $(LIBXINEPOSIX) $(RT_LIBS) $(NET_LIBS) $(XDG_BASEDIR_LIBS) + $(LIBXINEPOSIX) $(RT_LIBS) $(NET_LIBS) $(XDG_BASEDIR_LIBS) \ + $(AVUTIL_LIBS) libxine_la_LDFLAGS = $(AM_LDFLAGS) $(def_ldflags) \ -version-info $(XINE_LT_CURRENT):$(XINE_LT_REVISION):$(XINE_LT_AGE) diff --git a/src/xine-engine/buffer.c b/src/xine-engine/buffer.c index 93ad75ba0..c116f180a 100644 --- a/src/xine-engine/buffer.c +++ b/src/xine-engine/buffer.c @@ -36,6 +36,9 @@ #include #include +/* libavutil from FFmpeg */ +#include + /********** logging **********/ #define LOG_MODULE "buffer" #define LOG_VERBOSE @@ -358,7 +361,7 @@ static void fifo_buffer_dispose (fifo_buffer_t *this) { received++; } - free (this->buffer_pool_base); + av_free (this->buffer_pool_base); pthread_mutex_destroy(&this->mutex); pthread_cond_destroy(&this->not_empty); pthread_mutex_destroy(&this->buffer_pool_mutex); @@ -497,7 +500,6 @@ fifo_buffer_t *_x_fifo_buffer_new (int num_buffers, uint32_t buf_size) { fifo_buffer_t *this; int i; - int alignment = 2048; unsigned char *multi_buffer = NULL; this = xine_xmalloc (sizeof (fifo_buffer_t)); @@ -527,15 +529,11 @@ fifo_buffer_t *_x_fifo_buffer_new (int num_buffers, uint32_t buf_size) { */ - if (buf_size % alignment != 0) - buf_size += alignment - (buf_size % alignment); - /* - printf ("Allocating %d buffers of %ld bytes in one chunk (alignment = %d)\n", - num_buffers, (long int) buf_size, alignment); + printf ("Allocating %d buffers of %ld bytes in one chunk\n", + num_buffers, (long int) buf_size); */ - multi_buffer = xine_xmalloc_aligned (alignment, num_buffers * buf_size, - &this->buffer_pool_base); + multi_buffer = this->buffer_pool_base = av_mallocz (num_buffers * buf_size); this->buffer_pool_top = NULL; -- cgit v1.2.3