From f5ee190e36c10998c155019dfeb38f4b607c2a4f Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Sun, 8 Mar 2009 16:31:49 +0000 Subject: Run libtoolize before aclocal. --- autogen.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autogen.sh b/autogen.sh index f3ad2a99d..d54f9b4e9 100755 --- a/autogen.sh +++ b/autogen.sh @@ -290,15 +290,15 @@ case "$1" in run_libtoolize ;; noconfig) - run_aclocal run_libtoolize + run_aclocal run_autoheader run_automake run_autoconf ;; *) - run_aclocal run_libtoolize + run_aclocal run_autoheader run_automake run_autoconf -- cgit v1.2.3 From 7c9b436f8f40aa3f2f75bf2ecad543758d897330 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Sun, 8 Mar 2009 16:33:02 +0000 Subject: Enable libmpeg2new only if configured with --enable-libmpeg2new. --- ChangeLog | 4 ++-- configure.ac | 4 ++++ src/libmpeg2new/Makefile.am | 6 +++++- src/libmpeg2new/libmpeg2/Makefile.am | 6 +++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9f0d49954..b79f283f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ xine-lib (1.1.17) 2009-??-?? - * Enable libmpeg2new. This is not yet production code; the old mpeg2 - decoder remains the default. + * Enable libmpeg2new (if configured with --enable-libmpeg2new). + This is not yet production code; the old mpeg2 decoder remains the default. * Add support for OpenBSD. * Fix a build failure on *BSD due to some rather useful GNUisms. * Protect audio loop so it cannot write to a paused device (fix diff --git a/configure.ac b/configure.ac index c822e17a0..102081e58 100644 --- a/configure.ac +++ b/configure.ac @@ -323,6 +323,10 @@ dnl --------------------------------------------- AC_SUBST(LIBMPEG2_CFLAGS) +AC_ARG_ENABLE([libmpeg2new], + AS_HELP_STRING([--enable-libmpeg2new], [build the newer MPEG2 decoder (buggy)])) +AM_CONDITIONAL(ENABLE_MPEG2NEW, test "x$enable_libmpeg2new" = "xyes") + AC_ARG_WITH([external-ffmpeg], AS_HELP_STRING([--with-external-ffmpeg], [use external ffmpeg library])) case "x$with_external_ffmpeg" in diff --git a/src/libmpeg2new/Makefile.am b/src/libmpeg2new/Makefile.am index a91e5bea6..8b05a5444 100644 --- a/src/libmpeg2new/Makefile.am +++ b/src/libmpeg2new/Makefile.am @@ -3,7 +3,11 @@ include $(top_srcdir)/misc/Makefile.common SUBDIRS = include libmpeg2 -xineplug_LTLIBRARIES = xineplug_decode_mpeg2new.la +if ENABLE_MPEG2NEW +mpeg2new_module = xineplug_decode_mpeg2new.la +endif + +xineplug_LTLIBRARIES = $(mpeg2new_module) xineplug_decode_mpeg2new_la_SOURCES = \ xine_mpeg2new_decoder.c diff --git a/src/libmpeg2new/libmpeg2/Makefile.am b/src/libmpeg2new/libmpeg2/Makefile.am index 760505a51..0bfeda1ce 100644 --- a/src/libmpeg2new/libmpeg2/Makefile.am +++ b/src/libmpeg2new/libmpeg2/Makefile.am @@ -1,6 +1,10 @@ include $(top_srcdir)/misc/Makefile.common -noinst_LTLIBRARIES = libmpeg2.la libmpeg2arch.la +if ENABLE_MPEG2NEW +mpeg2new_libs = libmpeg2.la libmpeg2arch.la +endif + +noinst_LTLIBRARIES = $(mpeg2new_libs) libmpeg2_la_SOURCES = alloc.c header.c decode.c slice.c motion_comp.c idct.c libmpeg2_la_LIBADD = libmpeg2arch.la -- cgit v1.2.3 From e2e4a31eef68c45ed4954d25b6b92eabbafef2ce Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Sun, 8 Mar 2009 20:30:50 +0100 Subject: Fix build with libavutil >= 50.0.0 PIX_FMT_RGBA32 was #defined to PIX_FMT_RGB32 since 2006. --- ChangeLog | 1 + src/combined/ffmpeg/ff_video_decoder.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b79f283f2..2f4000c28 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ xine-lib (1.1.17) 2009-??-?? * Fix a build failure on *BSD due to some rather useful GNUisms. * Protect audio loop so it cannot write to a paused device (fix pause/resume freeze with pulseaudio). + * Fix build with libavutil >= 50.0.0. xine-lib (1.1.16.2) 2009-02-10 * Build fixes related to ImageMagick 6.4 & later. diff --git a/src/combined/ffmpeg/ff_video_decoder.c b/src/combined/ffmpeg/ff_video_decoder.c index e119b2b21..c272bc91a 100644 --- a/src/combined/ffmpeg/ff_video_decoder.c +++ b/src/combined/ffmpeg/ff_video_decoder.c @@ -588,7 +588,7 @@ static void ff_convert_frame(ff_video_decoder_t *this, vo_frame_t *img) { img->width, this->bih.biHeight); - } else if (this->context->pix_fmt == PIX_FMT_RGBA32) { + } else if (this->context->pix_fmt == PIX_FMT_RGB32) { int x, plane_ptr = 0; uint32_t *argb_pixels; @@ -1304,7 +1304,7 @@ static void ff_handle_buffer (ff_video_decoder_t *this, buf_element_t *buf) { /* initialize the colorspace converter */ if (!this->cs_convert_init) { - if ((this->context->pix_fmt == PIX_FMT_RGBA32) || + if ((this->context->pix_fmt == PIX_FMT_RGB32) || (this->context->pix_fmt == PIX_FMT_RGB565) || (this->context->pix_fmt == PIX_FMT_RGB555) || (this->context->pix_fmt == PIX_FMT_BGR24) || -- cgit v1.2.3 From 3863a132e3e7dd0fe4aab68a811a9732717a217b Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Mon, 9 Mar 2009 16:53:14 +0000 Subject: MPEG block demuxer fixup (prevents, e.g., segfaults when playing VCDs). --- ChangeLog | 1 + src/demuxers/demux_mpeg_block.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2f4000c28..aada6125c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ xine-lib (1.1.17) 2009-??-?? * Protect audio loop so it cannot write to a paused device (fix pause/resume freeze with pulseaudio). * Fix build with libavutil >= 50.0.0. + * Fix segfaults when playing VCDs. xine-lib (1.1.16.2) 2009-02-10 * Build fixes related to ImageMagick 6.4 & later. diff --git a/src/demuxers/demux_mpeg_block.c b/src/demuxers/demux_mpeg_block.c index 4fa96faeb..ffbc63f3d 100644 --- a/src/demuxers/demux_mpeg_block.c +++ b/src/demuxers/demux_mpeg_block.c @@ -1417,7 +1417,8 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str } input->seek(input, 0, SEEK_SET); - if (input->read(input, this->scratch, this->blocksize) == this->blocksize) { + memset (this->scratch, 255, 5); /* result of input->read() won't matter */ + if (input->read(input, this->scratch, this->blocksize)) { lprintf("open_plugin:read worked\n"); if (this->scratch[0] || this->scratch[1] -- cgit v1.2.3 From ee2fbe251bffe9f3db12cf448760cf2ff12dc634 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20Ni=C3=9Fl?= Date: Sun, 15 Mar 2009 21:37:06 +0100 Subject: Fix thread starvation for xine_get_param() on multi-core systems. ao_loop() called sched_yield() to give other threads a chance to acquire driver->lock. But on multi-core systems, it takes too long to wake up the acquiring thread so that ao_loop() takes driver->lock again before the other threads had a chance to acquire it. Therefore a cond var is introduced which ao_loop() can wait for. The cond var will be signalled when one of the other threads has acquired driver->lock. This prevents starvation. --- src/xine-engine/audio_out.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c index 170a64be0..a6f83dc9d 100644 --- a/src/xine-engine/audio_out.c +++ b/src/xine-engine/audio_out.c @@ -215,6 +215,7 @@ typedef struct { int num_driver_actions; /* number of threads, that wish to call * functions needing driver_lock */ pthread_mutex_t driver_action_lock; /* protects num_driver_actions */ + pthread_cond_t driver_action_cond; /* informs about num_driver_actions-- */ metronom_clock_t *clock; xine_t *xine; @@ -1283,8 +1284,15 @@ static void *ao_loop (void *this_gen) { /* Give other threads a chance to use functions which require this->driver_lock to * be available. This is needed when using NPTL on Linux (and probably PThreads * on Solaris as well). */ - if (this->num_driver_actions > 0) - sched_yield(); + if (this->num_driver_actions > 0) { + /* calling sched_yield() is not sufficient on multicore systems */ + /* sched_yield(); */ + /* instead wait for the other thread to acquire this->driver_lock */ + pthread_mutex_lock(&this->driver_action_lock); + if (this->num_driver_actions > 0) + pthread_cond_wait(&this->driver_action_cond, &this->driver_action_lock); + pthread_mutex_unlock(&this->driver_action_lock); + } } if (in_buf) { @@ -1475,6 +1483,8 @@ static inline void dec_num_driver_actions(aos_t *this) { pthread_mutex_lock(&this->driver_action_lock); this->num_driver_actions--; + /* indicate the change to ao_loop() */ + pthread_cond_broadcast(&this->driver_action_cond); pthread_mutex_unlock(&this->driver_action_lock); } @@ -1677,6 +1687,7 @@ static void ao_exit(xine_audio_port_t *this_gen) { } pthread_mutex_destroy(&this->driver_lock); + pthread_cond_destroy(&this->driver_action_cond); pthread_mutex_destroy(&this->driver_action_lock); pthread_mutex_destroy(&this->streams_lock); xine_list_delete(this->streams); @@ -2081,6 +2092,7 @@ xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver, pthread_mutex_init( &this->streams_lock, NULL ); pthread_mutex_init( &this->driver_lock, &attr ); pthread_mutex_init( &this->driver_action_lock, NULL ); + pthread_cond_init( &this->driver_action_cond, NULL ); this->ao.open = ao_open; this->ao.get_buffer = ao_get_buffer; -- cgit v1.2.3 From c3580b925a6c33105ee483d3c616a16f8ce0bba9 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Sun, 15 Mar 2009 21:25:16 +0000 Subject: Complain if both and are present. (Should have done this ages ago...) --- configure.ac | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac index 102081e58..595b7b3f5 100644 --- a/configure.ac +++ b/configure.ac @@ -353,6 +353,10 @@ if test "x$with_external_ffmpeg" != "xno"; then dnl Check presence of ffmpeg/avutil.h to see if it's old or new dnl style for headers. The new style would be preferred actually... AC_CHECK_HEADERS([ffmpeg/avutil.h]) + AC_CHECK_HEADERS([libavutil/avutil.h]) + if test "$ac_cv_header_ffmpeg_avutil_h" = "yes" && test "$ac_cv_header_libavutil_avutil_h" = "yes"; then + AC_MSG_ERROR([old & new ffmpeg headers found - you need to clean up!]) + fi AC_MSG_RESULT([using external ffmpeg]) else -- cgit v1.2.3