[cfe-dev] Compiling FFmpeg

John Kelley jekelley at apple.com
Fri Dec 5 03:21:52 PST 2008


To familiarize myself with clang I decided to try to compile FFmpeg as  
I am familiar with the project and the developers first guess when  
something goes wrong is "gcc is probably doing something stupid again".

This might seem like a lot to start off with and I'd tend to agree but  
less went wrong (so far) than I expected. The main issue thus far is  
that clang has trouble initializing structures. Below may not be the  
cleanest code but it was the simplest that I could find that produces  
an error:

(from ffmpeg/libavutil/crc.c)

typedef enum {
     AV_CRC_8_ATM,
     AV_CRC_16_ANSI,
     AV_CRC_16_CCITT,
     AV_CRC_32_IEEE,
     AV_CRC_32_IEEE_LE,  /*< reversed bitorder version of  
AV_CRC_32_IEEE */
     AV_CRC_MAX,         /*< not part of public API! don't use outside  
lavu */
}AVCRCId;

static struct {
     uint8_t  le;
     uint8_t  bits;
     uint32_t poly;
} av_crc_table_params[AV_CRC_MAX] = {
     [AV_CRC_8_ATM]      = { 0,  8,       0x07 },
     [AV_CRC_16_ANSI]    = { 0, 16,     0x8005 },
     [AV_CRC_16_CCITT]   = { 0, 16,     0x1021 },
     [AV_CRC_32_IEEE]    = { 0, 32, 0x04C11DB7 },
     [AV_CRC_32_IEEE_LE] = { 1, 32, 0xEDB88320 },
};

This produces the following error:
crc.c:31:37: error: cannot codegen this initializer list with  
designators yet
} av_crc_table_params[AV_CRC_MAX] = {
                                     ^

I have no problem pitching in to fix this but wanted to make sure that  
no one else is currently working on it and to ask where I should look  
to implement this.

Also I was planning on taking a shot at the File Manager Speedup  
project listed in NOTES.txt unless there are any objections.

Cheers,
John Kelley



More information about the cfe-dev mailing list