[FFmpeg-devel] [PATCH]Fix PGC compilation

Carl Eugen Hoyos cehoyos at ag.or.at
Wed Apr 17 00:06:41 CEST 2013


Hi!

configure claims we support Portland Group Compiler, but compilation fails in 
pngenc.c flvdec.c and srtenc.c.
Attached patches fixes the first two, compilation in srtenc.c fails because of 
the following line:
.color            = srt_color_cb,
(renaming the element in ass_split.h helps)

Or should we drop pgc from configure? fate fails for dnxhd-rd (32bit) and 
several more tests for 64bit, xtea works fine.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index a401c78..5ba5983 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -57,8 +57,9 @@ static void png_get_interlaced_row(uint8_t *dst, int row_size,
     int x, mask, dst_x, j, b, bpp;
     uint8_t *d;
     const uint8_t *s;
+    static const int masks[] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff};
 
-    mask =  (int[]){0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff}[pass];
+    mask = masks[pass];
     switch(bits_per_pixel) {
     case 1:
         memset(dst, 0, row_size);
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 0bb51e0..f1e6e33 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -742,9 +742,10 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
         }
     }
     if(i == s->nb_streams){
+        static const int stream_types[] = {AVMEDIA_TYPE_VIDEO, AVMEDIA_TYPE_AUDIO, AVMEDIA_TYPE_DATA};
         av_log(s, AV_LOG_WARNING, "Stream discovered after head already parsed\n");
         st = create_stream(s,
-             (int[]){AVMEDIA_TYPE_VIDEO, AVMEDIA_TYPE_AUDIO, AVMEDIA_TYPE_DATA}[stream_type]);
+                           stream_types[stream_type]);
         if (!st)
             return AVERROR(ENOMEM);
 


More information about the ffmpeg-devel mailing list