diff options
author | Thomas Günther <tom@toms-cafe.de> | 2010-03-27 00:48:53 +0100 |
---|---|---|
committer | Thomas Günther <tom@toms-cafe.de> | 2010-03-27 00:48:53 +0100 |
commit | 3f29c96c552f606eddc76aae6ed37f1d64f271c0 (patch) | |
tree | 5b884c57fe0dd3e5c7b10bc24b5316f442b5c462 | |
parent | 780c9f6d98de42a1004878d23007d487152d2de6 (diff) | |
download | vdr-plugin-osdpip-3f29c96c552f606eddc76aae6ed37f1d64f271c0.tar.gz vdr-plugin-osdpip-3f29c96c552f606eddc76aae6ed37f1d64f271c0.tar.bz2 |
Fixed ffmpeg compatibility issues with newer ffmpeg versions
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | decoder.c | 16 |
2 files changed, 17 insertions, 0 deletions
@@ -10,6 +10,7 @@ ____-__-__: Version 0.1.0 - Updated FSF address in the license information - Added support for VDR >= 1.7.13 (Make.global) - Use pkg-config to find compilation flags, libs etc for ffmpeg +- Fixed ffmpeg compatibility issues with newer ffmpeg versions 2010-01-01: Version 0.0.10a - added support for VDR 1.7.x @@ -82,14 +82,22 @@ int cDecoder::Resample(int width, int height, bool ConvertToRGB) context = sws_getContext(m_Context->width - (OsdPipSetup.CropLeft + OsdPipSetup.CropRight), m_Context->height - (OsdPipSetup.CropTop + OsdPipSetup.CropBottom), PIX_FMT_YUV420P, +#ifdef USE_NEW_FFMPEG_HEADERS + m_Width, m_Height, ConvertToRGB ? PIX_FMT_RGB32 : PIX_FMT_YUV420P, +#else m_Width, m_Height, ConvertToRGB ? PIX_FMT_RGBA32 : PIX_FMT_YUV420P, +#endif SWS_LANCZOS, NULL, NULL, NULL); if (!context) { printf("Error initializing scale context.\n"); return -1; } avpicture_fill((AVPicture *) m_PicResample, m_BufferResample, +#ifdef USE_NEW_FFMPEG_HEADERS + ConvertToRGB ? PIX_FMT_RGB32 : PIX_FMT_YUV420P, +#else ConvertToRGB ? PIX_FMT_RGBA32 : PIX_FMT_YUV420P, +#endif m_Width, m_Height); sws_scale(context, pic_crop.data, pic_crop.linesize, 0, m_Context->height - (OsdPipSetup.CropTop + OsdPipSetup.CropBottom), @@ -121,8 +129,16 @@ int cDecoder::Resample(int width, int height, bool ConvertToRGB) if (ConvertToRGB) { avpicture_fill((AVPicture *) m_PicConvert, m_BufferConvert, +#ifdef USE_NEW_FFMPEG_HEADERS + PIX_FMT_RGB32, m_Width, m_Height); +#else PIX_FMT_RGBA32, m_Width, m_Height); +#endif +#ifdef USE_NEW_FFMPEG_HEADERS + img_convert((AVPicture *) m_PicConvert, PIX_FMT_RGB32, +#else img_convert((AVPicture *) m_PicConvert, PIX_FMT_RGBA32, +#endif (AVPicture *) m_PicResample, PIX_FMT_YUV420P, m_Width, m_Height); } |