Package: avifile
Severity: normal
Tags: patch
When building 'avifile' on amd64 with gcc-4.0,
I get the following error:
x86_64-linux-g++ -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
-pipe -o .libs/aviplay actioncfg.o main.o playercontrol.o decoder_config.o
configdialog.o configdialog_impl.o ../libavqt/.libs/libqavm.so
/usr/lib/libqt-mt.so ../lib/.libs/libaviplay.so /usr/lib/libSDL.so -lpthread
-L/usr/X11R6/lib -lSM -lICE -lXinerama -lXv -lXxf86vm -lXxf86dga -lXi -lXext
-lX11 -lnsl -ldl
../lib/.libs/libaviplay.so: undefined reference to
`avm::AviPlayer::m_fDropLimit'
../lib/.libs/libaviplay.so: undefined reference to
`avm::AudioQueue::MAX_BUFFER_TIME'
collect2: ld returned 1 exit status
make[2]: *** [aviplay] Error 1
make[2]: Leaving directory `/avifile-0.7.38.20030710/player'
With the attached patch 'avifile' can be compiled
on amd64 using gcc-4.0.
The attached patch contains parts which were already necessary for gcc-3.4
(see #264543 and also 285677).
Regards
Andreas Jochens
diff -urN ../tmp-orig/avifile-0.7.38.20030710/lib/aviplay/AudioQueue.h
./lib/aviplay/AudioQueue.h
--- ../tmp-orig/avifile-0.7.38.20030710/lib/aviplay/AudioQueue.h
2002-09-24 09:16:28.000000000 +0200
+++ ./lib/aviplay/AudioQueue.h 2005-02-09 20:53:10.000000000 +0100
@@ -16,10 +16,11 @@
virtual int Mix(void* data, const void* src, uint_t n) const = 0;
};
+#define MAX_BUFFER_TIME 1.0;
+
class AudioQueue
{
public:
- static const double MAX_BUFFER_TIME = 1.0;
AudioQueue(WAVEFORMATEX& Iwf, WAVEFORMATEX& Owf);
~AudioQueue();
diff -urN ../tmp-orig/avifile-0.7.38.20030710/lib/aviplay/aviplay_impl.h
./lib/aviplay/aviplay_impl.h
--- ../tmp-orig/avifile-0.7.38.20030710/lib/aviplay/aviplay_impl.h
2003-05-27 17:40:34.000000000 +0200
+++ ./lib/aviplay/aviplay_impl.h 2005-02-09 20:57:04.000000000 +0100
@@ -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 -urN ../tmp-orig/avifile-0.7.38.20030710/lib/aviplay/aviplayth.cpp
./lib/aviplay/aviplayth.cpp
--- ../tmp-orig/avifile-0.7.38.20030710/lib/aviplay/aviplayth.cpp
2003-05-26 10:03:41.000000000 +0200
+++ ./lib/aviplay/aviplayth.cpp 2005-02-09 20:58:01.000000000 +0100
@@ -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 -urN ../tmp-orig/avifile-0.7.38.20030710/ffmpeg/libavcodec/avcodec.c
./ffmpeg/libavcodec/avcodec.c
--- ../tmp-orig/avifile-0.7.38.20030710/ffmpeg/libavcodec/avcodec.c
2003-07-10 09:36:33.000000000 +0200
+++ ./ffmpeg/libavcodec/avcodec.c 2005-02-09 20:41:56.000000000 +0100
@@ -103,13 +103,13 @@
{
// pin char* codec name
private_handle_t* h = create_handle();
- (private_handle_t**)pout = h;
+ pout = h;
if (!h)
return -ENOMEM;
if (!h->avcodec)
{
destroy_handle(h);
- (private_handle_t**)pout = NULL;
+ pout = NULL;
return -1;// better error
}
return 0;
@@ -118,14 +118,14 @@
{
// pin uint32_t codec fourcc
private_handle_t* h = create_handle();
- (private_handle_t**)pout = h;
+ pout = h;
if (!h)
return -ENOMEM;
if (!h->avcodec)
{
destroy_handle(h);
- (private_handle_t**)pout = NULL;
+ pout = NULL;
return -1;// better error
}
return 0;
@@ -134,14 +134,14 @@
{
// pin uint32_t codec fourcc
private_handle_t* h = create_handle();
- (private_handle_t**)pout = h;
+ pout = h;
if (!h)
return -ENOMEM;
h->avcodec = avcodec_find_by_fcc((uint32_t) pin);
if (!h->avcodec)
{
destroy_handle(h);
- (private_handle_t**)pout = NULL;
+ pout = NULL;
return -1;// better error
}
return 0;
@@ -163,7 +163,7 @@
break;
case AVC_GET_VERSION:
- (int*) pout = 500;
+ pout = (void*)500;
default:
return -1;
diff -urN ../tmp-orig/avifile-0.7.38.20030710/ffmpeg/libavcodec/dsputil.h
./ffmpeg/libavcodec/dsputil.h
--- ../tmp-orig/avifile-0.7.38.20030710/ffmpeg/libavcodec/dsputil.h
2003-06-23 20:52:32.000000000 +0200
+++ ./ffmpeg/libavcodec/dsputil.h 2005-02-09 20:41:56.000000000 +0100
@@ -477,19 +477,4 @@
+name8(s, dst+8+8*stride, src+8+8*stride, stride);\
}
-#ifndef HAVE_LRINTF
-/* XXX: add ISOC specific test to avoid specific BSD testing. */
-/* better than nothing implementation. */
-/* btw, rintf() is existing on fbsd too -- alex */
-static inline long int lrintf(float x)
-{
-#ifdef CONFIG_WIN32
- /* XXX: incorrect, but make it compile */
- return (int)(x);
-#else
- return (int)(rint(x));
-#endif
-}
-#endif
-
#endif
diff -urN ../tmp-orig/avifile-0.7.38.20030710/ffmpeg/libavcodec/ra144.c
./ffmpeg/libavcodec/ra144.c
--- ../tmp-orig/avifile-0.7.38.20030710/ffmpeg/libavcodec/ra144.c
2003-07-02 22:51:50.000000000 +0200
+++ ./ffmpeg/libavcodec/ra144.c 2005-02-09 20:41:56.000000000 +0100
@@ -485,7 +485,7 @@
*((int16_t *)data)=s;
if (s>32767) *((int16_t *)data)=32767;
if (s<-32767) *((int16_t *)data)=-32768;
- ((int16_t *)data)++;
+ data = ((int16_t *)data) + 1;
}
b+=30;
}
diff -urN ../tmp-orig/avifile-0.7.38.20030710/ffmpeg/libavcodec/wmadec.c
./ffmpeg/libavcodec/wmadec.c
--- ../tmp-orig/avifile-0.7.38.20030710/ffmpeg/libavcodec/wmadec.c
2003-07-07 11:37:16.000000000 +0200
+++ ./ffmpeg/libavcodec/wmadec.c 2005-02-09 20:41:56.000000000 +0100
@@ -22,6 +22,7 @@
* WMA compatible decoder.
*/
+#include <math.h>
#include "avcodec.h"
#include "dsputil.h"
diff -urN ../tmp-orig/avifile-0.7.38.20030710/ffmpeg/libavformat/mpeg.c
./ffmpeg/libavformat/mpeg.c
--- ../tmp-orig/avifile-0.7.38.20030710/ffmpeg/libavformat/mpeg.c
2003-07-10 15:38:40.000000000 +0200
+++ ./ffmpeg/libavformat/mpeg.c 2005-02-09 20:41:56.000000000 +0100
@@ -61,9 +61,9 @@
#define AUDIO_ID 0xc0
#define VIDEO_ID 0xe0
-extern AVOutputFormat mpeg1system_mux;
-extern AVOutputFormat mpeg1vcd_mux;
-extern AVOutputFormat mpeg2vob_mux;
+static AVOutputFormat mpeg1system_mux;
+static AVOutputFormat mpeg1vcd_mux;
+static AVOutputFormat mpeg2vob_mux;
static int put_pack_header(AVFormatContext *ctx,
uint8_t *buf, int64_t timestamp)
diff -urN ../tmp-orig/avifile-0.7.38.20030710/include/aviplay.h
./include/aviplay.h
--- ../tmp-orig/avifile-0.7.38.20030710/include/aviplay.h 2003-05-25
00:51:30.000000000 +0200
+++ ./include/aviplay.h 2005-02-09 20:41:56.000000000 +0100
@@ -12,8 +12,8 @@
#include "image.h"
#include "avm_args.h"
-typedef void (*KILLHANDLER)(int, void* p = 0);
-typedef int (*AUDIOFUNC)(void* srcdata, unsigned int size, void* p = 0);
+typedef void (*KILLHANDLER)(int, void* p);
+typedef int (*AUDIOFUNC)(void* srcdata, unsigned int size, void* p);
AVM_BEGIN_NAMESPACE;
diff -urN ../tmp-orig/avifile-0.7.38.20030710/include/avm_map.h
./include/avm_map.h
--- ../tmp-orig/avifile-0.7.38.20030710/include/avm_map.h 2003-03-27
02:01:22.000000000 +0100
+++ ./include/avm_map.h 2005-02-09 20:41:56.000000000 +0100
@@ -198,7 +198,7 @@
{
// cast to the needed type - used to prevent internal compiler error
// for old egcc
- avm_map<Key, Value, Compare, Equal>::_Tnode* node = (avm_map<Key, Value,
Compare, Equal>::_Tnode*) n;
+ typename avm_map<Key, Value, Compare, Equal>::_Tnode* node = (typename
avm_map<Key, Value, Compare, Equal>::_Tnode*) n;
if(node->entry)
{
diff -urN ../tmp-orig/avifile-0.7.38.20030710/include/avm_stl.h
./include/avm_stl.h
--- ../tmp-orig/avifile-0.7.38.20030710/include/avm_stl.h 2003-06-08
17:57:05.000000000 +0200
+++ ./include/avm_stl.h 2005-02-09 20:41:56.000000000 +0100
@@ -141,6 +141,8 @@
uint_t capacity() const { return m_uiCapacity; }
Type& operator[](int i) { i += fpos(); return m_Type[i >=
(int)m_uiCapacity ? i - m_uiCapacity : i]; }
const Type& operator[](int i) const { return m_Type[i]; }
+
+ qring<Type>(const qring<Type>& t) {}
protected:
Type* m_Type;
uint_t m_uiCapacity;
@@ -149,7 +151,6 @@
// disabled for now
qring<Type>() {}
- qring<Type>(const qring<Type>& t) {}
uint_t bpos() const { return (m_uiPos > 0) ? m_uiPos - 1 : m_uiCapacity -
1; }
uint_t fpos() const { return (m_uiSize > m_uiPos) ? m_uiPos + m_uiCapacity
- m_uiSize: m_uiPos - m_uiSize; }
@@ -272,7 +273,7 @@
};
template <class Type>
-vector<Type>::vector<Type>(int prealloc)
+vector<Type>::vector(int prealloc)
:m_Type(0), m_uiCapacity(prealloc), m_uiSize(prealloc)
{
if (m_uiCapacity > 0 )
diff -urN
../tmp-orig/avifile-0.7.38.20030710/lib/aviread/AsfNetworkInputStream.cpp
./lib/aviread/AsfNetworkInputStream.cpp
--- ../tmp-orig/avifile-0.7.38.20030710/lib/aviread/AsfNetworkInputStream.cpp
2003-05-27 17:26:31.000000000 +0200
+++ ./lib/aviread/AsfNetworkInputStream.cpp 2005-02-09 20:41:56.000000000
+0100
@@ -588,7 +588,8 @@
close(m_iSocket);
m_iSocket = -1;
flushPipe();
- return (void*)result;
+ void *void_result = (void*) result;
+ return void_result;
}
void* AsfNetworkInputStream::threadStarter(void* arg)
@@ -801,7 +802,7 @@
int i = ::write(m_iSocket, buffer, wsize);
if (i <= 0)
return i;
- (const char*)buffer += i;
+ buffer = ((const char*)buffer) + i;
wsize -= i;
}
return size;
@@ -843,7 +844,7 @@
int i = ::write(m_lfd, buffer, size);
if (i < 0)
return i;
- (const char*)buffer += i;
+ buffer = ((const char*)buffer) + i;
size -= i;
}
fsync(m_lfd);
diff -urN ../tmp-orig/avifile-0.7.38.20030710/lib/aviread/ReadFile.cpp
./lib/aviread/ReadFile.cpp
--- ../tmp-orig/avifile-0.7.38.20030710/lib/aviread/ReadFile.cpp
2003-05-25 01:05:16.000000000 +0200
+++ ./lib/aviread/ReadFile.cpp 2005-02-09 20:41:56.000000000 +0100
@@ -128,7 +128,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;
diff -urN ../tmp-orig/avifile-0.7.38.20030710/lib/common/image.cpp
./lib/common/image.cpp
--- ../tmp-orig/avifile-0.7.38.20030710/lib/common/image.cpp 2003-05-25
01:00:58.000000000 +0200
+++ ./lib/common/image.cpp 2005-02-09 20:41:56.000000000 +0100
@@ -954,7 +954,7 @@
fillMembers();
if (!copy)
{
- (const uint8_t*) m_pPlane[0] = data;
+ m_pPlane[0] = (unsigned char *) data;
}
else
{
diff -urN ../tmp-orig/avifile-0.7.38.20030710/plugins/libvorbis/libvorbis.cpp
./plugins/libvorbis/libvorbis.cpp
--- ../tmp-orig/avifile-0.7.38.20030710/plugins/libvorbis/libvorbis.cpp
2003-05-20 16:33:13.000000000 +0200
+++ ./plugins/libvorbis/libvorbis.cpp 2005-02-09 20:41:56.000000000 +0100
@@ -96,7 +96,7 @@
op.packet = NULL;
op.b_o_s = 1; /* beginning of stream for first packet */
op.bytes = hdrsizes[0];
- (const void*) op.packet = vorbishdr;
+ op.packet = (unsigned char *) vorbishdr;
vorbishdr += op.bytes;
if (vorbis_synthesis_headerin(&vi, &vc, &op) < 0)
{
@@ -106,7 +106,7 @@
op.b_o_s = 0;
op.bytes = hdrsizes[1];
- (const void*) op.packet = vorbishdr;
+ op.packet = (unsigned char *) vorbishdr;
vorbishdr += op.bytes;
if (vorbis_synthesis_headerin(&vi, &vc, &op) < 0)
{
@@ -115,7 +115,7 @@
}
op.bytes = hdrsizes[2];
- (const void*) op.packet = vorbishdr;
+ op.packet = (unsigned char *) vorbishdr;
vorbishdr += op.bytes;
if (vorbis_synthesis_headerin(&vi, &vc, &op) < 0)
{
diff -urN ../tmp-orig/avifile-0.7.38.20030710/samples/qtvidcap/kv4lsetup.cpp
./samples/qtvidcap/kv4lsetup.cpp
--- ../tmp-orig/avifile-0.7.38.20030710/samples/qtvidcap/kv4lsetup.cpp
2003-04-04 12:57:30.000000000 +0200
+++ ./samples/qtvidcap/kv4lsetup.cpp 2005-02-09 20:41:56.000000000 +0100
@@ -309,7 +309,7 @@
fbuf.depth = set_bpp;
fbuf.bytesperline = set_bpl;
if (set_base != NULL)
- fbuf.base = (void*)((unsigned int)set_base+(unsigned int)shift);
+ fbuf.base = (void*)((unsigned long)set_base+(unsigned long)shift);
/* XXX bttv confuses color depth and bits/pixel */
#ifndef X_DISPLAY_MISSING
diff -urN ../tmp-orig/avifile-0.7.38.20030710/samples/qtvidcap/v4lxif.cpp
./samples/qtvidcap/v4lxif.cpp
--- ../tmp-orig/avifile-0.7.38.20030710/samples/qtvidcap/v4lxif.cpp
2003-06-09 17:02:08.000000000 +0200
+++ ./samples/qtvidcap/v4lxif.cpp 2005-02-09 20:41:56.000000000 +0100
@@ -1118,7 +1118,7 @@
XF86DGAGetVideoLL(disp, DefaultScreen(disp), (int *)&base,
&width, &bank, &ram );
if (!base)
avml(AVML_WARN,
- "v4l1: can not allocate frame buffer base:
0x%x\n",(int)base);
+ "v4l1: can not allocate frame buffer base:
0x%lx\n",(long)base);
}
}
}
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]