From 3b076d574b3e2ae13eebef53756014acf8b485df Mon Sep 17 00:00:00 2001 From: Carlo Bramini Date: Tue, 5 Jun 2012 11:41:03 +0300 Subject: ffmpeg_compat.h: fixed version check for old ffmpeg versions --- src/combined/ffmpeg/ffmpeg_compat.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/combined/ffmpeg/ffmpeg_compat.h b/src/combined/ffmpeg/ffmpeg_compat.h index 69b9aa30e..f0a49d7f2 100644 --- a/src/combined/ffmpeg/ffmpeg_compat.h +++ b/src/combined/ffmpeg/ffmpeg_compat.h @@ -24,10 +24,14 @@ #define XINE_AVCODEC_COMPAT_H #ifndef LIBAVCODEC_VERSION_MAJOR -# error ffmpeg headers must be included first ! +# ifdef LIBAVCODEC_VERSION_INT +# define LIBAVCODEC_VERSION_MAJOR ((LIBAVCODEC_VERSION_INT)>>16) +# define LIBAVCODEC_VERSION_MINOR (((LIBAVCODEC_VERSION_INT)>>8) & 0xff) +# else +# error ffmpeg headers must be included first ! +# endif #endif - #if LIBAVCODEC_VERSION_MAJOR > 51 # define bits_per_sample bits_per_coded_sample #endif -- cgit v1.2.3 From 589cd12c0ba1294f9d36358a07f0d782de09415e Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Tue, 5 Jun 2012 11:52:38 +0300 Subject: Added check for AVCodecContext.color_range and AVCodecContext.colorspace --- src/combined/ffmpeg/ff_video_decoder.c | 12 ++++++++++-- src/combined/ffmpeg/ffmpeg_compat.h | 5 +++++ 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/combined/ffmpeg/ff_video_decoder.c b/src/combined/ffmpeg/ff_video_decoder.c index f7817556f..ecd59ab80 100644 --- a/src/combined/ffmpeg/ff_video_decoder.c +++ b/src/combined/ffmpeg/ff_video_decoder.c @@ -145,12 +145,20 @@ struct ff_video_decoder_s { static void ff_check_colorspace (ff_video_decoder_t *this) { int i, cm; +#ifdef AVCODEC_HAS_COLORSPACE cm = this->context->colorspace << 1; +#else + cm = 0; +#endif + /* ffmpeg bug: color_range not set by svq3 decoder */ i = this->context->pix_fmt; - if (cm && ((i == PIX_FMT_YUVJ420P) || (i == PIX_FMT_YUVJ444P) || - (this->context->color_range == AVCOL_RANGE_JPEG))) + if (cm && ((i == PIX_FMT_YUVJ420P) || (i == PIX_FMT_YUVJ444P))) cm |= 1; +#ifdef AVCODEC_HAS_COLORSPACE + if (this->context->color_range == AVCOL_RANGE_JPEG) + cm |= 1; +#endif /* report changes of colorspyce and/or color range */ if (cm != this->color_matrix) { diff --git a/src/combined/ffmpeg/ffmpeg_compat.h b/src/combined/ffmpeg/ffmpeg_compat.h index f0a49d7f2..f025dfec6 100644 --- a/src/combined/ffmpeg/ffmpeg_compat.h +++ b/src/combined/ffmpeg/ffmpeg_compat.h @@ -48,6 +48,11 @@ # undef AVCODEC_HAS_REORDERED_OPAQUE #endif +/* colorspace and color_range were added before 52.29.0 */ +#if LIBAVCODEC_VERSION_MAJOR > 52 || (LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR >= 29) +# define AVCODEC_HAS_COLORSPACE +#endif + /**/ #if LIBAVCODEC_VERSION_MAJOR > 53 || (LIBAVCODEC_VERSION_MAJOR == 53 && LIBAVCODEC_VERSION_MINOR >= 8) # define avcodec_init() do {} while(0) -- cgit v1.2.3 From 70d56fc1262d7e2f47677a2501d220b5d1a6e74f Mon Sep 17 00:00:00 2001 From: Carlo Bramini Date: Tue, 5 Jun 2012 11:54:55 +0300 Subject: Added missing ifdef AVCODEC_HAS_REORDERED_OPAQUE --- src/combined/ffmpeg/ff_video_decoder.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/combined/ffmpeg/ff_video_decoder.c b/src/combined/ffmpeg/ff_video_decoder.c index ecd59ab80..8693f0e67 100644 --- a/src/combined/ffmpeg/ff_video_decoder.c +++ b/src/combined/ffmpeg/ff_video_decoder.c @@ -470,9 +470,10 @@ static void init_video_codec (ff_video_decoder_t *this, unsigned int codec_type) break; } +#ifdef AVCODEC_HAS_REORDERED_OPAQUE /* dont want initial AV_NOPTS_VALUE here */ this->context->reordered_opaque = 0; - +#endif } static void choose_speed_over_accuracy_cb(void *user_data, xine_cfg_entry_t *entry) { -- cgit v1.2.3 From 7b4ba1fcb3772f8998813b1a76a0ef964fa69538 Mon Sep 17 00:00:00 2001 From: Carlo Bramini Date: Tue, 5 Jun 2012 12:10:49 +0300 Subject: Fix building with cygwin CYGWIN is a full POSIX environment, it does not need to include windows.h (it even causes an error if you try). --- src/xine-utils/utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/xine-utils/utils.c b/src/xine-utils/utils.c index 82cf5c0d4..4a8dd4bff 100644 --- a/src/xine-utils/utils.c +++ b/src/xine-utils/utils.c @@ -42,6 +42,7 @@ #include #include #include +#include #if HAVE_EXECINFO_H #include @@ -55,8 +56,7 @@ #include #endif -#if defined(__CYGWIN__) || defined(WIN32) -#include +#if defined(WIN32) #include #endif -- cgit v1.2.3 From 43d2cc9a1598132bda53d1e95bf7f90e5cc82fab Mon Sep 17 00:00:00 2001 From: Carlo Bramini Date: Tue, 5 Jun 2012 12:18:46 +0300 Subject: Fixed -no-undefined handling with mingw and cygwin "-no-undefined" is not a linker flag, it's a libtool flag, so it must be removed from LDFLAGS for CYGWIN and MINGW. There is already another variable for that purpose. --- src/xine-engine/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/xine-engine/Makefile.am b/src/xine-engine/Makefile.am index 67ae63fae..535be3557 100644 --- a/src/xine-engine/Makefile.am +++ b/src/xine-engine/Makefile.am @@ -10,7 +10,7 @@ lib_LTLIBRARIES = libxine.la XINEUTILS_LIB = $(top_builddir)/src/xine-utils/libxineutils.la DEF_FILE = libxine-$(XINE_MAJOR).def if WIN32 -def_ldflags=-Wl,--output-def,$(DEF_FILE) $(LDFLAGS_NOUNDEFINED) +def_ldflags=-Wl,--output-def,$(DEF_FILE) endif libxine_la_SOURCES = xine.c metronom.c configfile.c buffer.c \ @@ -30,7 +30,7 @@ libxine_la_LIBADD = $(PTHREAD_LIBS) $(DYNAMIC_LD_LIBS) $(LTLIBINTL) $(ZLIB_LIBS) -lm $(XINEUTILS_LIB) $(LTLIBICONV) $(FT2_LIBS) $(FONTCONFIG_LIBS) \ $(LIBXINEPOSIX) $(RT_LIBS) $(NET_LIBS) -libxine_la_LDFLAGS = \ +libxine_la_LDFLAGS = $(LDFLAGS_NOUNDEFINED) \ -version-info $(XINE_LT_CURRENT):$(XINE_LT_REVISION):$(XINE_LT_AGE) \ $(def_ldflags) -- cgit v1.2.3