Ubuntu Pastebin

Paste from philipl at Mon, 27 Nov 2017 04:42:45 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
commit 9a2849d8d0c3a317e0d783ce51ede3fe1f5f4985
Author: Philip Langdale <philipl@overt.org>
Date:   Sun Nov 26 20:40:32 2017 -0800

    avcodec/nvdec: Make vp8 initialisation more 'compatible'
    
    Ancient versions of gcc (pre 4.6) can't directly initialise
    members of anonymous inner unions/structs by name.
    
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10676
    
    Unfortunately, CentOS 6 shipped with one of these ancient
    versions and so we're stuck with it until approximately the
    heat death of the universe.
    
    Putting explicit braces into the initialisation is possibly a
    work-around but the behaviour there was never fully understood
    before direct initialisation was made to work.
    
    So, this may or may not work.

diff --git a/libavcodec/nvdec_vp8.c b/libavcodec/nvdec_vp8.c
index ceb3de2c3a..222133d44d 100644
--- a/libavcodec/nvdec_vp8.c
+++ b/libavcodec/nvdec_vp8.c
@@ -64,11 +64,20 @@ static int nvdec_vp8_start_frame(AVCodecContext *avctx, const uint8_t *buffer, u
             .LastRefIdx                  = safe_get_ref_idx(h->framep[VP56_FRAME_PREVIOUS]),
             .GoldenRefIdx                = safe_get_ref_idx(h->framep[VP56_FRAME_GOLDEN]),
             .AltRefIdx                   = safe_get_ref_idx(h->framep[VP56_FRAME_GOLDEN2]),
-
-            .frame_type                  = !h->keyframe,
-            .version                     = h->profile,
-            .show_frame                  = !h->invisible,
-            .update_mb_segmentation_data = h->segmentation.enabled ? h->segmentation.update_feature_data : 0,
+            /*
+             * Explicit braces for anonymous inners so work around limitations
+             * in ancient versions of gcc.
+             */
+            {
+                {
+                    .frame_type                  = !h->keyframe,
+                    .version                     = h->profile,
+                    .show_frame                  = !h->invisible,
+                    .update_mb_segmentation_data = h->segmentation.enabled ?
+                                                   h->segmentation.update_feature_data :
+                                                   0,
+                }
+            }
        }
     };
 
Download as text