Submitted By:            Randy McMurchy <randy_at_linuxfromscratch_dot_org>
Date:                    2005-09-07
Initial Package Version: 0.7.43
Upstream Status:         From upstream CVS (not 100% sure about the FFmpeg fixes)
Origin:                  The FFmpeg fixes are ported from the the
                         ffmpeg-0.4.9-pre1-gcc4-1.patch. All the other fixes come
                         from upstream CVS.
Description:             Fixes GCC-4.0.x build problems


diff -Naur avifile-0.7-0.7.43-orig/ffmpeg/libavcodec/avcodec.h avifile-0.7-0.7.43/ffmpeg/libavcodec/avcodec.h
--- avifile-0.7-0.7.43-orig/ffmpeg/libavcodec/avcodec.h	2005-02-24 11:31:10.000000000 +0000
+++ avifile-0.7-0.7.43/ffmpeg/libavcodec/avcodec.h	2005-09-08 00:38:31.000000000 +0000
@@ -1813,6 +1813,14 @@
 #define FF_OPT_MAX_DEPTH 10
 } AVOption;
 
+struct AVOption;
+#ifdef HAVE_MMX
+extern const struct AVOption avoptions_common[3 + 5];
+#else
+extern const struct AVOption avoptions_common[3];
+#endif
+extern const struct AVOption avoptions_workaround_bug[11];
+
 /**
  * Parse option(s) and sets fields in passed structure
  * @param strct	structure where the parsed results will be written

diff -Naur avifile-0.7-0.7.43-orig/ffmpeg/libavcodec/common.h avifile-0.7-0.7.43/ffmpeg/libavcodec/common.h
--- avifile-0.7-0.7.43-orig/ffmpeg/libavcodec/common.h	2005-02-15 12:33:33.000000000 +0000
+++ avifile-0.7-0.7.43/ffmpeg/libavcodec/common.h	2005-09-08 00:38:31.000000000 +0000
@@ -54,14 +54,6 @@
 #define AVOPTION_SUB(ptr) { .name = NULL, .help = (const char*)ptr }
 #define AVOPTION_END() AVOPTION_SUB(NULL)
 
-struct AVOption;
-#ifdef HAVE_MMX
-extern const struct AVOption avoptions_common[3 + 5];
-#else
-extern const struct AVOption avoptions_common[3];
-#endif
-extern const struct AVOption avoptions_workaround_bug[11];
-
 #endif /* HAVE_AV_CONFIG_H */
 
 /* Suppress restrict if it was not defined in config.h.  */

diff -Naur avifile-0.7-0.7.43-orig/lib/aviplay/AudioQueue.h avifile-0.7-0.7.43/lib/aviplay/AudioQueue.h
--- avifile-0.7-0.7.43-orig/lib/aviplay/AudioQueue.h	2004-08-25 16:29:06.000000000 +0000
+++ avifile-0.7-0.7.43/lib/aviplay/AudioQueue.h	2005-09-08 00:38:31.000000000 +0000
@@ -10,6 +10,9 @@
 class IAudioResampler;
 class IAudioCleaner;
 
+// buggy gcc-4.0 refused to compile static const double 
+#define MAX_BUFFER_TIME 1.0 
+
 class IAudioMix
 {
 public:
@@ -19,7 +22,7 @@
 class AudioQueue
 {
 public:
-    static const double MAX_BUFFER_TIME = 1.0;
+    //static const double MAX_BUFFER_TIME = 1.0;
     AudioQueue(WAVEFORMATEX& Iwf, WAVEFORMATEX& Owf);
     ~AudioQueue();
 

diff -Naur avifile-0.7-0.7.43-orig/lib/aviplay/aviplay_impl.h avifile-0.7-0.7.43/lib/aviplay/aviplay_impl.h
--- avifile-0.7-0.7.43-orig/lib/aviplay/aviplay_impl.h	2003-12-17 20:37:54.000000000 +0000
+++ avifile-0.7-0.7.43/lib/aviplay/aviplay_impl.h	2005-09-08 00:38:31.000000000 +0000
@@ -136,8 +136,6 @@
     void createAudioRenderer();
     int restartVideoStreaming(const char* codec = 0);
 
-    static const float m_fDropLimit = -0.015;
-
     mutable int AviPlayer::propertyRead[LAST_PROPERTY]; // have we read at least once from Registry::
 
     avm::vector<IVideoRenderer*> m_VideoRenderers; // we could draw image to more places

diff -Naur avifile-0.7-0.7.43-orig/lib/aviplay/aviplayth.cpp avifile-0.7-0.7.43/lib/aviplay/aviplayth.cpp
--- avifile-0.7-0.7.43-orig/lib/aviplay/aviplayth.cpp	2004-10-25 10:27:42.000000000 +0000
+++ avifile-0.7-0.7.43/lib/aviplay/aviplayth.cpp	2005-09-08 00:38:31.000000000 +0000
@@ -31,6 +31,7 @@
 // preffer video playing thread
 static const int PRIORITY_ADD_VIDEO = 0;
 static const int PRIORITY_ADD_AUDIO = 0;
+static const float m_fDropLimit = -0.015;
 
 float AviPlayer::getVideoAsync()
 {

diff -Naur avifile-0.7-0.7.43-orig/lib/aviread/ReadFile.cpp avifile-0.7-0.7.43/lib/aviread/ReadFile.cpp
--- avifile-0.7-0.7.43-orig/lib/aviread/ReadFile.cpp	2004-03-10 17:00:09.000000000 +0000
+++ avifile-0.7-0.7.43/lib/aviread/ReadFile.cpp	2005-09-08 00:38:31.000000000 +0000
@@ -8,7 +8,7 @@
 
 AVM_BEGIN_NAMESPACE;
 
-avm::IReadFile::~IReadFile() {}
+IReadFile::~IReadFile() {}
 
 class ReadFile: public IReadFile
 {
@@ -125,7 +125,7 @@
 };
 
 
-avm::IReadFile* avm::CreateReadFile(const char* name, unsigned int flags)
+IReadFile* CreateReadFile(const char* name, unsigned int flags)
 {
     ReadFile* r = new ReadFile(name, flags);
     return r;
