[vlc-commits] bluray: implement overlay wiping
Petri Hintukainen
git at videolan.org
Fri Nov 27 16:39:59 CET 2015
vlc | branch: master | Petri Hintukainen <phintuka at gmail.com> | Fri Nov 27 17:33:56 2015 +0200| [aa28acb1a5bd980ea99167e3507f4f3795b84a1b] | committer: Jean-Baptiste Kempf
bluray: implement overlay wiping
Fixes duplicate menu selector images with some HDMV discs.
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=aa28acb1a5bd980ea99167e3507f4f3795b84a1b
---
modules/access/bluray.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/modules/access/bluray.c b/modules/access/bluray.c
index dea11c1..7e3e40d 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -1180,12 +1180,10 @@ static void blurayDrawOverlay(demux_t *p_demux, const BD_OVERLAY* const ov)
* Compute a subpicture_region_t.
* It will be copied and sent to the vout later.
*/
- if (!ov->img)
- return;
-
vlc_mutex_lock(&p_sys->p_overlays[ov->plane]->lock);
/* Find a region to update */
+ subpicture_region_t **pp_reg = &p_sys->p_overlays[ov->plane]->p_regions;
subpicture_region_t *p_reg = p_sys->p_overlays[ov->plane]->p_regions;
subpicture_region_t *p_last = NULL;
while (p_reg != NULL) {
@@ -1193,9 +1191,20 @@ static void blurayDrawOverlay(demux_t *p_demux, const BD_OVERLAY* const ov)
if (p_reg->i_x == ov->x && p_reg->i_y == ov->y &&
p_reg->fmt.i_width == ov->w && p_reg->fmt.i_height == ov->h)
break;
+ pp_reg = &p_reg->p_next;
p_reg = p_reg->p_next;
}
+ if (!ov->img) {
+ if (p_reg) {
+ /* drop region */
+ *pp_reg = p_reg->p_next;
+ subpicture_region_Delete(p_reg);
+ }
+ vlc_mutex_unlock(&p_sys->p_overlays[ov->plane]->lock);
+ return;
+ }
+
/* If there is no region to update, create a new one. */
if (!p_reg) {
video_format_t fmt;
@@ -1267,6 +1276,7 @@ static void blurayOverlayProc(void *ptr, const BD_OVERLAY *const overlay)
blurayActivateOverlay(p_demux, overlay->plane);
break;
case BD_OVERLAY_DRAW:
+ case BD_OVERLAY_WIPE:
blurayDrawOverlay(p_demux, overlay);
break;
default:
More information about the vlc-commits
mailing list