[vlc-commits] access: bluray: check stride difference

Francois Cartegnie git at videolan.org
Mon Mar 9 14:51:58 CET 2020


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Mar  9 14:26:01 2020 +0100| [6c005312e9383e81ba4d1876b56834f636cce135] | committer: Francois Cartegnie

access: bluray: check stride difference

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

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

diff --git a/modules/access/bluray.c b/modules/access/bluray.c
index bab725f2c0..252c625f3e 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -2072,11 +2072,19 @@ static void blurayDrawArgbOverlay(demux_t *p_demux, const BD_ARGB_OVERLAY* const
                            p_reg->p_picture->p[0].i_pitch * eventov->y +
                            eventov->x * 4;
 
-    for (int y = 0; y < eventov->h; y++)
+    /* always true as for now, see bd_bdj_osd_cb */
+    if(likely(eventov->stride == p_reg->p_picture->p[0].i_pitch / 4))
+    {
+        memcpy(dst0, src0, (eventov->stride * eventov->h - eventov->x)*4);
+    }
+    else
     {
-        memcpy(dst0, src0, eventov->w * 4);
-        src0 += eventov->stride;
-        dst0 += p_reg->p_picture->p[0].i_pitch;
+        for(uint16_t h = 0; h < eventov->h; h++)
+        {
+            memcpy(dst0, src0, eventov->w * 4);
+            src0 += eventov->stride;
+            dst0 += p_reg->p_picture->p[0].i_pitch;
+        }
     }
 
     vlc_mutex_unlock(&ov->lock);



More information about the vlc-commits mailing list