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/xine-engine') 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 From 86aaaf9492b320350431f52f92053cf72ba9e8da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Fri, 14 Dec 2007 19:21:31 +0100 Subject: Remove internal FFmpeg reference from build system. --- src/xine-engine/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/Makefile.am b/src/xine-engine/Makefile.am index fa53965a3..8b7fc1d63 100644 --- a/src/xine-engine/Makefile.am +++ b/src/xine-engine/Makefile.am @@ -33,7 +33,7 @@ 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) $(AVUTIL_DEPS) \ +libxine_la_DEPENDENCIES = $(XINEUTILS_LIB) $(XDG_BASEDIR_DEPS) \ $(pthread_dep) $(LIBXINEPOSIX) libxine_la_LIBADD = $(PTHREAD_LIBS) $(DYNAMIC_LD_LIBS) $(LTLIBINTL) $(ZLIB_LIBS) \ -lm $(XINEUTILS_LIB) $(LTLIBICONV) $(FT2_LIBS) $(FONTCONFIG_LIBS) \ -- cgit v1.2.3 From 5d9d7aee83cb3e5db29640f985b6d69e0060e39d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sat, 1 Mar 2008 03:35:51 +0100 Subject: Use libavutil's base64 functions, and get rid again of internal copy of base64. --- src/xine-engine/configfile.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/configfile.c b/src/xine-engine/configfile.c index 37a4e38ad..a41abf193 100644 --- a/src/xine-engine/configfile.c +++ b/src/xine-engine/configfile.c @@ -33,7 +33,7 @@ #include #include #include "bswap.h" -#include "base64.h" +#include #define LOG_MODULE "configfile" #define LOG_VERBOSE @@ -1342,7 +1342,12 @@ static char* config_get_serialized_entry (config_values_t *this, const char *key } /* and now the output encoding */ - output = _x_base64_encode (buffer, total_len, &output_len); + /* We're going to encode total_len bytes in base64 + * libavutil's base64 encoding functions want the size to + * be at least len * 4 / 3 + 12, so let's use that! + */ + output = malloc(total_len * 4 / 3 + 12); + av_base64_encode(output, total_len * 4 / 3 + 12, buffer, total_len); free(buffer); } @@ -1410,11 +1415,13 @@ static char* config_register_serialized_entry (config_values_t *this, const char int bytes; int pos; void *output = NULL; - unsigned long output_len; + size_t output_len; int value_count = 0; int i; - output = _x_base64_decode (value, strlen(value), &output_len); + output_len = strlen(value) * 3 / 4 + 1; + output = malloc(output_len); + av_base64_decode(output, value, output_len); pos = 0; pos += bytes = get_int(output, output_len, pos, &type); -- cgit v1.2.3 From 19357940a57c565ebe319729bd08d6e4800aff5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sat, 1 Mar 2008 04:00:18 +0100 Subject: Update to the new FFmpeg's include directory. This also allows to remove the comment stating the includes come from libavutil, as it's now explicit. --- src/xine-engine/buffer.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/buffer.c b/src/xine-engine/buffer.c index bcef6df32..605fbaa09 100644 --- a/src/xine-engine/buffer.c +++ b/src/xine-engine/buffer.c @@ -36,8 +36,7 @@ #include #include -/* libavutil from FFmpeg */ -#include +#include /********** logging **********/ #define LOG_MODULE "buffer" -- cgit v1.2.3 From 8063ffb8c0b354d54834ba53b22003dac481de2c Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Wed, 9 Apr 2008 19:10:58 +0100 Subject: Compilation fixes, mostly ffmpeg-related, and linkage fixes. Tests done on amd64 with ffmpeg 0.svn20080206 from Debian experimental. libavcodec 51.50.0, libavutil 49.6.0, libpostproc 51.1.0 --- src/xine-engine/buffer.c | 2 +- src/xine-engine/configfile.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/buffer.c b/src/xine-engine/buffer.c index 605fbaa09..6b6d48a11 100644 --- a/src/xine-engine/buffer.c +++ b/src/xine-engine/buffer.c @@ -36,7 +36,7 @@ #include #include -#include +#include /********** logging **********/ #define LOG_MODULE "buffer" diff --git a/src/xine-engine/configfile.c b/src/xine-engine/configfile.c index 9f67b7503..c3b698be7 100644 --- a/src/xine-engine/configfile.c +++ b/src/xine-engine/configfile.c @@ -33,7 +33,7 @@ #include #include #include "bswap.h" -#include +#include #define LOG_MODULE "configfile" #define LOG_VERBOSE -- cgit v1.2.3