diff options
| author | Petri Hintukainen <phintuka@users.sourceforge.net> | 2012-06-05 12:47:26 +0300 |
|---|---|---|
| committer | Petri Hintukainen <phintuka@users.sourceforge.net> | 2012-06-05 12:47:26 +0300 |
| commit | b631217b97e6e63807a2e7195658d12de0236f58 (patch) | |
| tree | b478fb90aedd7925769e8a0b2887c0aa9734786e /src/combined/ffmpeg | |
| parent | 4e1f6c532f001e0aebc11738cb1ff2c70a1f4472 (diff) | |
| parent | 8ef238a8cc53fe097808e79de0682b140ff07057 (diff) | |
| download | xine-lib-b631217b97e6e63807a2e7195658d12de0236f58.tar.gz xine-lib-b631217b97e6e63807a2e7195658d12de0236f58.tar.bz2 | |
Merge from 1.1
Diffstat (limited to 'src/combined/ffmpeg')
| -rw-r--r-- | src/combined/ffmpeg/ff_video_decoder.c | 15 | ||||
| -rw-r--r-- | src/combined/ffmpeg/ffmpeg_compat.h | 13 |
2 files changed, 23 insertions, 5 deletions
diff --git a/src/combined/ffmpeg/ff_video_decoder.c b/src/combined/ffmpeg/ff_video_decoder.c index 4a0fd57dc..ca3e488fa 100644 --- a/src/combined/ffmpeg/ff_video_decoder.c +++ b/src/combined/ffmpeg/ff_video_decoder.c @@ -143,12 +143,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) { @@ -460,9 +468,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) { diff --git a/src/combined/ffmpeg/ffmpeg_compat.h b/src/combined/ffmpeg/ffmpeg_compat.h index 69b9aa30e..f025dfec6 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 @@ -44,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) |
