From 4c6cc601c29b79f681d895bd6bab970854eca1c8 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 17 Jun 2011 08:41:56 +0000 Subject: [PATCH] Build fix --- src/osgPlugins/ffmpeg/FFmpegHeaders.hpp | 1 - src/osgPlugins/ffmpeg/FFmpegParameters.cpp | 14 +++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/osgPlugins/ffmpeg/FFmpegHeaders.hpp b/src/osgPlugins/ffmpeg/FFmpegHeaders.hpp index 749ccc365..2050ad12e 100644 --- a/src/osgPlugins/ffmpeg/FFmpegHeaders.hpp +++ b/src/osgPlugins/ffmpeg/FFmpegHeaders.hpp @@ -12,7 +12,6 @@ extern "C" #include #include #include -#include #ifdef USE_SWSCALE #include diff --git a/src/osgPlugins/ffmpeg/FFmpegParameters.cpp b/src/osgPlugins/ffmpeg/FFmpegParameters.cpp index 95bbab1ee..152ab1c08 100644 --- a/src/osgPlugins/ffmpeg/FFmpegParameters.cpp +++ b/src/osgPlugins/ffmpeg/FFmpegParameters.cpp @@ -5,6 +5,18 @@ #include #include +#if LIBAVCODEC_VERSION_MAJOR >= 53 || \ + (LIBAVCODEC_VERSION_MAJOR==52 && LIBAVCODEC_VERSION_MINOR>=73) || \ + (LIBAVCODEC_VERSION_MAJOR==52 && LIBAVCODEC_VERSION_MINOR==72 && LIBAVCODEC_VERSION_MICRO >= 2) + + #include + inline PixelFormat osg_av_get_pix_fmt(const char *name) { return av_get_pix_fmt(name); } + +#else + inline PixelFormat osg_av_get_pix_fmt(const char *name) { return avcodec_get_pix_fmt(name); } +#endif + + namespace osgFFmpeg { @@ -35,7 +47,7 @@ void FFmpegParameters::parse(const std::string& name, const std::string& value) } else if (name == "pixel_format") { - m_parameters.pix_fmt = av_get_pix_fmt(value.c_str()); + m_parameters.pix_fmt = osg_av_get_pix_fmt(value.c_str()); } else if (name == "frame_size") {