Index: /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegHeaders.hpp
===================================================================
--- /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegHeaders.hpp (revision 9827)
+++ /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegHeaders.hpp (revision 9854)
@@ -10,4 +10,9 @@
 #include <avcodec.h>
 #include <avformat.h>
+
+#ifdef USE_SWSCALE    
+    #include <swscale.h>
+#endif
+
 }
 
Index: /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp
===================================================================
--- /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp (revision 9837)
+++ /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp (revision 9854)
@@ -6,4 +6,5 @@
 #include <string.h>
 
+#if 0
 extern "C" 
 {
@@ -12,4 +13,5 @@
 
 };
+#endif
 
 namespace osgFFmpeg {
@@ -28,5 +30,6 @@
     m_user_data(0),
     m_publish_func(0),
-    m_exit(false)
+    m_exit(false),
+    m_swscale_ctx(0)
 {
 
@@ -41,4 +44,10 @@
         m_exit = true;
         join();
+    }
+    
+    if (m_swscale_ctx)
+    {
+        sws_freeContext(m_swscale_ctx);
+        m_swscale_ctx = 0;
     }
 }
@@ -211,4 +220,23 @@
 }
 
+int FFmpegDecoderVideo::convert(AVPicture *dst, int dst_pix_fmt, const AVPicture *src,
+            int src_pix_fmt, int src_width, int src_height)
+{
+#ifdef USE_SWSCALE
+    if (m_swscale_ctx==0)
+    {
+        m_swscale_ctx = sws_getContext(src_width, src_height, src_pix_fmt,
+                                      src_width, src_height, dst_pix_fmt,                                    
+                                      SWS_BILINEAR, NULL, NULL, NULL);
+    }
+    
+    return sws_scale(m_swscale_ctx,
+           src->data, src->linesize, 0, src_height,
+           dst->data, dst->linesize);
+#else
+    return convert(dst, dst_pix_fmt, src,
+                   src_pix_fmt, src_width, src_height)
+#endif
+}
 
 
@@ -231,5 +259,5 @@
         yuva420pToRgba(dst, src, width(), height());
     else
-        img_convert(dst, PIX_FMT_RGB32, src, m_context->pix_fmt, width(), height());
+        convert(dst, PIX_FMT_RGB32, src, m_context->pix_fmt, width(), height());
 
     // Flip and swap buffer
@@ -267,5 +295,5 @@
 void FFmpegDecoderVideo::yuva420pToRgba(AVPicture * const dst, const AVPicture * const src, int width, int height)
 {
-    img_convert(dst, PIX_FMT_RGB32, src, m_context->pix_fmt, width, height);
+    convert(dst, PIX_FMT_RGB32, src, m_context->pix_fmt, width, height);
 
     const size_t bpp = 4;
Index: /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/ReaderWriterFFmpeg.cpp
===================================================================
--- /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/ReaderWriterFFmpeg.cpp (revision 9838)
+++ /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/ReaderWriterFFmpeg.cpp (revision 9854)
@@ -46,5 +46,7 @@
             return ReadResult::FILE_NOT_HANDLED;
 
-        const std::string path = osgDB::findDataFile(filename, options);
+        const std::string path = osgDB::containsServerAddress(filename) ?
+            filename :
+            osgDB::findDataFile(filename, options);
 
         if (path.empty())
Index: /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp
===================================================================
--- /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp (revision 9840)
+++ /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp (revision 9854)
@@ -90,32 +90,40 @@
     void yuva420pToRgba(AVPicture *dst, const AVPicture *src, int width, int height);
 
+    int convert(AVPicture *dst, int dst_pix_fmt, const AVPicture *src,
+                int src_pix_fmt, int src_width, int src_height);
+
+
     static int getBuffer(AVCodecContext * context, AVFrame * picture);
     static void releaseBuffer(AVCodecContext * context, AVFrame * picture);
 
-    PacketQueue &        m_packets;
-    FFmpegClocks &        m_clocks;
-    AVStream *            m_stream;
-    AVCodecContext *    m_context;
-    AVCodec *            m_codec;
-    const uint8_t *        m_packet_data;
-    int                    m_bytes_remaining;
-    int64_t                m_packet_pts;
+    PacketQueue &           m_packets;
+    FFmpegClocks &          m_clocks;
+    AVStream *              m_stream;
+    AVCodecContext *        m_context;
+    AVCodec *               m_codec;
+    const uint8_t *         m_packet_data;
+    int                     m_bytes_remaining;
+    int64_t                 m_packet_pts;
     
-    FramePtr            m_frame;
-    FramePtr            m_frame_rgba;
-    Buffer                m_buffer_rgba;
-    Buffer                m_buffer_rgba_public;
+    FramePtr                m_frame;
+    FramePtr                m_frame_rgba;
+    Buffer                  m_buffer_rgba;
+    Buffer                  m_buffer_rgba_public;
 
-    void *                m_user_data;
-    PublishFunc            m_publish_func;
+    void *                  m_user_data;
+    PublishFunc             m_publish_func;
 
-    double                m_frame_rate;
-    double                m_aspect_ratio;
-    int                    m_width;
-    int                    m_height;
-    size_t                m_next_frame_index;
-    bool                m_alpha_channel;
+    double                  m_frame_rate;
+    double                  m_aspect_ratio;
+    int                     m_width;
+    int                     m_height;
+    size_t                  m_next_frame_index;
+    bool                    m_alpha_channel;
 
-    volatile bool        m_exit;
+    volatile bool           m_exit;
+    
+#if USE_SWSCALE    
+    struct SwsContext *     m_swscale_ctx;
+#endif
 };
 
Index: /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/CMakeLists.txt
===================================================================
--- /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/CMakeLists.txt (revision 9847)
+++ /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/CMakeLists.txt (revision 9854)
@@ -1,10 +1,34 @@
 # INCLUDE_DIRECTORIES( ${FFMPEG_INCLUDE_DIRS} )
 
-INCLUDE_DIRECTORIES( 
-    ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS} ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}/libavformat ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}/ffmpeg
-    ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS} ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS}/libavdevice ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS}/ffmpeg
-    ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS} ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}/libavcodec ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}/ffmpeg
-    ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS} ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}/libavcodec ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}/ffmpeg
-)
+IF (FFMPEG_LIBSWSCALE_FOUND)
+
+    INCLUDE_DIRECTORIES( 
+        ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS} ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}/libavformat ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}/ffmpeg
+        ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS} ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS}/libavdevice ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS}/ffmpeg
+        ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS} ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}/libavcodec ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}/ffmpeg
+        ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS} ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}/libavcodec ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}/ffmpeg
+        ${FFMPEG_LIBSWSCALE_INCLUDE_DIRS} ${FFMPEG_LIBSWSCALE_INCLUDE_DIRS}/libswscale ${FFMPEG_LIBSWSCALE_INCLUDE_DIRS}/ffmpeg
+    )
+
+    ADD_DEFINITIONS(-DUSE_SWSCALE)
+
+    LINK_DIRECTORIES(${FFMPEG_LIBRARY_DIRS})
+
+    SET(TARGET_EXTERNAL_LIBRARIES ${FFMPEG_LIBRARIES} ${FFMPEG_LIBSWSCALE_LIBRARIES})
+
+ELSE(FFMPEG_LIBSWSCALE_FOUND)
+
+    INCLUDE_DIRECTORIES( 
+        ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS} ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}/libavformat ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}/ffmpeg
+        ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS} ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS}/libavdevice ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS}/ffmpeg
+        ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS} ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}/libavcodec ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}/ffmpeg
+        ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS} ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}/libavcodec ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}/ffmpeg
+    )
+
+    LINK_DIRECTORIES(${FFMPEG_LIBRARY_DIRS})
+
+    SET(TARGET_EXTERNAL_LIBRARIES ${FFMPEG_LIBRARIES} )
+
+ENDIF()
 
 # MESSAGE("FFMPEG_LIBAVFORMAT_INCLUDE_DIRS = "  ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS} )
@@ -37,7 +61,4 @@
 )
 
-LINK_DIRECTORIES(${FFMPEG_LIBRARY_DIRS})
-
-SET(TARGET_EXTERNAL_LIBRARIES ${FFMPEG_LIBRARIES} )
 
 
Index: /OpenSceneGraph/trunk/CMakeModules/FindFFmpeg.cmake
===================================================================
--- /OpenSceneGraph/trunk/CMakeModules/FindFFmpeg.cmake (revision 9840)
+++ /OpenSceneGraph/trunk/CMakeModules/FindFFmpeg.cmake (revision 9854)
@@ -21,4 +21,5 @@
     pkg_check_modules(FFMPEG_LIBAVCODEC libavcodec)
     pkg_check_modules(FFMPEG_LIBAVUTIL libavutil)
+    pkg_check_modules(FFMPEG_LIBSWSCALE libswscale)
 
 ENDIF(PKG_CONFIG_FOUND)
