Remove two anonymous arrays.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Tue, 16 Apr 2013 22:37:05 +0000 (00:37 +0200)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Tue, 16 Apr 2013 22:37:05 +0000 (00:37 +0200)
Fixes compilation of pngenc.c and flvdec.c with PGC 13.4-0.

libavcodec/pngenc.c
libavformat/flvdec.c

index a401c78..5ba5983 100644 (file)
@@ -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);
index 0bb51e0..8bb56e8 100644 (file)
@@ -742,9 +742,10 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
         }
     }
     if(i == s->nb_streams){
+        static const enum AVMediaType 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);