[vlc-devel] [PATCH] bluray: implement overlay wiping
Petri Hintukainen
phintuka at gmail.com
Fri Nov 27 16:33:56 CET 2015
Fixes duplicate menu selector images with some HDMV discs.
---
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 bbaa426..c52961a 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -1192,12 +1192,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) {
@@ -1205,9 +1203,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;
@@ -1279,6 +1288,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:
--
2.5.0
More information about the vlc-devel
mailing list