[MPlayer-cvslog] r26175 - in trunk/libmpdemux: demux_avs.h demuxer.h ebml.h matroska.h mp3_hdr.h mpeg_packetizer.h muxer.h parse_es.h stheader.h

Uoti Urpala uoti.urpala at pp1.inet.fi
Thu Mar 6 02:33:30 CET 2008


On Thu, 2008-03-06 at 01:59 +0100, Diego Biurrun wrote:
> We got ourselves the first bug uncovered by the new #include scheme:
> 
> cc  -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement -I. -I.. -I../libavutil -Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 -march=k6-3 -mtune=k6-3 -pipe -ffast-math -fomit-frame-pointer -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DHAVE_CONFIG_H -I/usr/include/directfb -I/usr/include/  -I/usr/include/SDL -D_REENTRANT -I/usr/include/kde/artsc -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -I/usr/include/freetype2 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12     -c -o ve_vfw.o ve_vfw.c
> In file included from ../libmpdemux/muxer.h:7,
>                  from ve_vfw.c:31:
> ../libmpdemux/aviheader.h:78: error: conflicting types for 'MainAVIHeader'
> ../loader/wine/avifmt.h:186: error: previous declaration of 'MainAVIHeader' was here
> ../libmpdemux/aviheader.h:102: error: conflicting types for 'AVIStreamHeader'
> ../loader/wine/avifmt.h:212: error: previous declaration of 'AVIStreamHeader' was here
> ../libmpdemux/aviheader.h:120: error: conflicting types for 'AVIINDEXENTRY'
> ../loader/wine/avifmt.h:230: error: previous declaration of 'AVIINDEXENTRY' was here
> make[1]: *** [ve_vfw.o] Error 1
> make[1]: Leaving directory `/var/tmp/mplayer_vanilla/libmpcodecs'
> make: *** [libmpcodecs/libmpcodecs.a] Error 2
> 
> libmpdemux/aviheader.h and loader/wine/avifmt.h have duplicate
> declarations with conflicting types.

And the actual bug (the uncovered one, not this commit breaking
compilation...) is that muxer.h depends on other headers to define types
like AVIStreamheader, which are then used in fields of shared structs.
Most .c files included libmpdemux/aviheader.h then muxer.h, but ve_vfw.c
included loader/wine/avifmt.h then muxer.h. Thus there were incompatible
definitions of a shared type in different .c files. Adding the required
includes to muxer.h so that it fully specifies the type meant uncovered
the incompatible definition in ve_vfw.c.

The binary layout of the incompatible structs is probably the same on
32-bit platforms (I didn't check carefully that it really is; on 64-bit
it would differ due to uint32_t vs unsigned long). So if the vfw stuff
only works on 32-bit anyway then it probably didn't cause visible
problems.

> Uoti suggested just removing the loader/wine/avifmt.h #include from
> ve_vfw.c, I'll look into it when I have had more sleep.

Since compilation is currently broken I'll change it to include
libmpdemux/aviheader.h. At least that makes it compile.




More information about the MPlayer-cvslog mailing list