[vlc-commits] bluray: fix background color

Petri Hintukainen git at videolan.org
Tue Oct 6 12:15:33 CEST 2015


vlc | branch: master | Petri Hintukainen <phintuka at gmail.com> | Mon Oct  5 11:54:20 2015 +0300| [887ce251b6c8fb8de1bf228f63a7f70c5c80a7f7] | committer: Jean-Baptiste Kempf

bluray: fix background color

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=887ce251b6c8fb8de1bf228f63a7f70c5c80a7f7
---

 modules/access/bluray.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/modules/access/bluray.c b/modules/access/bluray.c
index 2748e54..a183d01 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -364,7 +364,8 @@ static void startBackground(demux_t *p_demux)
       return;
     }
 
-    block_t *p_block = block_Alloc(1920 * 1080 * 3 / 2);
+    block_t *p_block = block_Alloc(fmt.video.i_width * fmt.video.i_height *
+                                   fmt.video.i_bits_per_pixel / 8);
     if (!p_block) {
         msg_Err(p_demux, "Error allocating block for background video");
         return;
@@ -374,9 +375,9 @@ static void startBackground(demux_t *p_demux)
     p_block->i_dts = p_block->i_pts = mdate() + CLOCK_FREQ/25;
 
     uint8_t *p = p_block->p_buffer;
-    memset(p, 0, 1920 * 1080);
-    p += 1920*1080;
-    memset(p, 0x80, 1920 * 1080 / 4);
+    memset(p, 0, fmt.video.i_width * fmt.video.i_height);
+    p += fmt.video.i_width * fmt.video.i_height;
+    memset(p, 0x80, fmt.video.i_width * fmt.video.i_height / 2);
 
     es_out_Send(p_demux->out, p_sys->p_dummy_video, p_block);
 }



More information about the vlc-commits mailing list