VideoTexture: AVFormatContext::pb is not a pointer for avformat library older than...
authorBenoit Bolsee <benoit.bolsee@online.be>
Sat, 1 Nov 2008 17:15:17 +0000 (17:15 +0000)
committerBenoit Bolsee <benoit.bolsee@online.be>
Sat, 1 Nov 2008 17:15:17 +0000 (17:15 +0000)
source/gameengine/VideoTexture/VideoFFmpeg.cpp
source/gameengine/VideoTexture/VideoFFmpeg.h

index 65bd5f4cbf489ba267bd0e118eef77e710cfab5e..19e10cf02f86d320c803d07b3c72d58bc35cefb5 100644 (file)
@@ -248,7 +248,13 @@ void VideoFFmpeg::openFile (char * filename)
        // open base class
        VideoBase::openFile(filename);
 
-       if (m_formatCtx->pb->is_streamed)
+       if (
+#ifdef FFMPEG_PB_IS_POINTER
+        m_formatCtx->pb->is_streamed
+#else
+        m_formatCtx->pb.is_streamed
+#endif
+        )
        {
                // the file is in fact a streaming source, prevent seeking
                m_isFile = false;
@@ -265,7 +271,7 @@ void VideoFFmpeg::openCam (char * file, short camIdx)
        AVInputFormat           *inputFormat;
        AVFormatParameters      formatParams;
        AVRational                      frameRate;
-       char                            filename[28], rateStr[20];
+       char                            *p, filename[28], rateStr[20];
 
        do_init_ffmpeg();
 
index 7980e06686c1a9cb5cb550a03b986b9b04d4f6d4..4720bef1841b64db5de7910a169f5520ab2eca20 100644 (file)
@@ -36,6 +36,10 @@ extern "C" {
 #define FFMPEG_CODEC_IS_POINTER 1
 #endif
 
+#if LIBAVFORMAT_VERSION_INT >= (52 << 16)
+#define FFMPEG_PB_IS_POINTER 1
+#endif
+
 #ifdef FFMPEG_CODEC_IS_POINTER
 static inline AVCodecContext* get_codec_from_stream(AVStream* stream)
 {