From ac8ee3792ccf9a9a6fa9d89e98a4da7e15227770 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 4 Mar 2009 11:59:15 +0000 Subject: [PATCH] Fixes to non swscale code path --- src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp b/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp index cf4206803..915118ed9 100644 --- a/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp +++ b/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp @@ -18,8 +18,10 @@ FFmpegDecoderVideo::FFmpegDecoderVideo(PacketQueue & packets, FFmpegClocks & clo m_packet_pts(AV_NOPTS_VALUE), m_user_data(0), m_publish_func(0), - m_exit(false), - m_swscale_ctx(0) + m_exit(false) +#ifdef USE_SWSCALE + ,m_swscale_ctx(0) +#endif { } @@ -34,11 +36,13 @@ FFmpegDecoderVideo::~FFmpegDecoderVideo() join(); } +#ifdef USE_SWSCALE if (m_swscale_ctx) { sws_freeContext(m_swscale_ctx); m_swscale_ctx = 0; } +#endif } @@ -219,12 +223,16 @@ int FFmpegDecoderVideo::convert(AVPicture *dst, int dst_pix_fmt, const AVPicture SWS_BILINEAR, NULL, NULL, NULL); } + osg::notify(osg::NOTICE)<<"Using sws_scale"<data, src->linesize, 0, src_height, dst->data, dst->linesize); #else - return im_convert(dst, dst_pix_fmt, src, - src_pix_fmt, src_width, src_height) + osg::notify(osg::NOTICE)<<"Using img_convert"<