[libbluray-devel] Build fixes

Ian Curtis git at videolan.org
Tue Sep 18 11:56:28 CEST 2012


libbluray | branch: master | Ian Curtis <dukeeeey at users.sourceforge.net> | Tue Sep 18 12:50:21 2012 +0300| [61009b982714731f2c19992ae0dd772da4ddd53d] | committer: hpi1

Build fixes

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=61009b982714731f2c19992ae0dd772da4ddd53d
---

 src/libbluray/bluray.c                       |   12 ++--
 src/libbluray/decoders/graphics_controller.c |   80 ++++++++++++--------------
 src/libbluray/register.c                     |   11 ++--
 3 files changed, 49 insertions(+), 54 deletions(-)

diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index d02b915..a11d928 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -2222,14 +2222,14 @@ static void _queue_initial_psr_events(BLURAY *bd)
         PSR_SECONDARY_AUDIO_VIDEO,
     };
     unsigned ii;
+    BD_PSR_EVENT ev;
+
+    ev.ev_type = BD_PSR_CHANGE;
+    ev.old_val = 0;
 
     for (ii = 0; ii < sizeof(psrs) / sizeof(psrs[0]); ii++) {
-        BD_PSR_EVENT ev = {
-            .ev_type = BD_PSR_CHANGE,
-            .psr_idx = psrs[ii],
-            .old_val = 0,
-            .new_val = bd_psr_read(bd->regs, psrs[ii]),
-        };
+        ev.psr_idx = psrs[ii];
+        ev.new_val = bd_psr_read(bd->regs, psrs[ii]);
 
         _process_psr_change_event(bd, &ev);
     }
diff --git a/src/libbluray/decoders/graphics_controller.c b/src/libbluray/decoders/graphics_controller.c
index 9eb122a..394771a 100644
--- a/src/libbluray/decoders/graphics_controller.c
+++ b/src/libbluray/decoders/graphics_controller.c
@@ -365,17 +365,18 @@ static void _reset_page_state(GRAPHICS_CONTROLLER *gc)
  * overlay operations
  */
 
+#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
+
 static void _open_osd(GRAPHICS_CONTROLLER *gc, int plane,
                       unsigned width, unsigned height)
 {
     if (gc->overlay_proc) {
-        const BD_OVERLAY ov = {
-            .cmd     = BD_OVERLAY_INIT,
-            .pts     = -1,
-            .plane   = plane,
-            .w       = width,
-            .h       = height,
-        };
+        BD_OVERLAY ov = {0};
+        ov.cmd          = BD_OVERLAY_INIT;
+        ov.pts          = -1;
+        ov.plane        = plane;
+        ov.w            = width;
+        ov.h            = height;
 
         gc->overlay_proc(gc->overlay_proc_handle, &ov);
 
@@ -390,11 +391,10 @@ static void _open_osd(GRAPHICS_CONTROLLER *gc, int plane,
 static void _close_osd(GRAPHICS_CONTROLLER *gc, int plane)
 {
     if (gc->overlay_proc) {
-        const BD_OVERLAY ov = {
-            .cmd     = BD_OVERLAY_CLOSE,
-            .pts     = -1,
-            .plane   = plane,
-        };
+        BD_OVERLAY ov = {0};
+        ov.cmd     = BD_OVERLAY_CLOSE;
+        ov.pts     = -1;
+        ov.plane   = plane;
 
         gc->overlay_proc(gc->overlay_proc_handle, &ov);
     }
@@ -411,11 +411,10 @@ static void _close_osd(GRAPHICS_CONTROLLER *gc, int plane)
 static void _flush_osd(GRAPHICS_CONTROLLER *gc, int plane, int64_t pts)
 {
     if (gc->overlay_proc) {
-        const BD_OVERLAY ov = {
-            .cmd     = BD_OVERLAY_FLUSH,
-            .pts     = pts,
-            .plane   = plane,
-        };
+        BD_OVERLAY ov = {0};
+        ov.cmd     = BD_OVERLAY_FLUSH;
+        ov.pts     = pts;
+        ov.plane   = plane;
 
         gc->overlay_proc(gc->overlay_proc_handle, &ov);
     }
@@ -426,15 +425,14 @@ static void _clear_osd_area(GRAPHICS_CONTROLLER *gc, int plane,
 {
     if (gc->overlay_proc) {
         /* wipe area */
-        const BD_OVERLAY ov = {
-            .cmd     = BD_OVERLAY_WIPE,
-            .pts     = -1,
-            .plane   = plane,
-            .x       = x,
-            .y       = y,
-            .w       = w,
-            .h       = h,
-        };
+        BD_OVERLAY ov = {0};
+        ov.cmd     = BD_OVERLAY_WIPE;
+        ov.pts     = -1;
+        ov.plane   = plane;
+        ov.x       = x;
+        ov.y       = y;
+        ov.w       = w;
+        ov.h       = h;
 
         gc->overlay_proc(gc->overlay_proc_handle, &ov);
     }
@@ -444,11 +442,10 @@ static void _clear_osd(GRAPHICS_CONTROLLER *gc, int plane)
 {
     if (gc->overlay_proc) {
         /* clear plane */
-        const BD_OVERLAY ov = {
-            .cmd     = BD_OVERLAY_CLEAR,
-            .pts     = -1,
-            .plane   = plane,
-        };
+        BD_OVERLAY ov = {0};
+        ov.cmd     = BD_OVERLAY_CLEAR;
+        ov.pts     = -1;
+        ov.plane   = plane;
 
         gc->overlay_proc(gc->overlay_proc_handle, &ov);
     }
@@ -480,17 +477,16 @@ static void _render_object(GRAPHICS_CONTROLLER *gc,
                            BD_PG_PALETTE *palette)
 {
     if (gc->overlay_proc) {
-        BD_OVERLAY ov = {
-            .cmd     = BD_OVERLAY_DRAW,
-            .pts     = pts,
-            .plane   = plane,
-            .x       = x,
-            .y       = y,
-            .w       = object->width,
-            .h       = object->height,
-            .palette = palette->entry,
-            .img     = object->img,
-        };
+        BD_OVERLAY ov = {0};
+        ov.cmd     = BD_OVERLAY_DRAW;
+        ov.pts     = pts;
+        ov.plane   = plane;
+        ov.x       = x;
+        ov.y       = y;
+        ov.w       = object->width;
+        ov.h       = object->height;
+        ov.palette = palette->entry;
+        ov.img     = object->img;
 
         gc->overlay_proc(gc->overlay_proc_handle, &ov);
     }
diff --git a/src/libbluray/register.c b/src/libbluray/register.c
index 57405df..c82fdbf 100644
--- a/src/libbluray/register.c
+++ b/src/libbluray/register.c
@@ -260,12 +260,11 @@ void bd_psr_save_state(BD_REGISTERS *p)
     /* generate save event */
 
     if (p->num_cb) {
-        BD_PSR_EVENT ev = {
-            .ev_type = BD_PSR_SAVE,
-            .psr_idx = -1,
-            .old_val = 0,
-            .new_val = 0,
-        };
+        BD_PSR_EVENT ev;
+        ev.ev_type = BD_PSR_SAVE;
+        ev.psr_idx = -1;
+        ev.old_val = 0;
+        ev.new_val = 0;
 
         unsigned j;
         for (j = 0; j < p->num_cb; j++) {



More information about the libbluray-devel mailing list