Commit aa28acb1 authored by Petri Hintukainen's avatar Petri Hintukainen Committed by Jean-Baptiste Kempf

bluray: implement overlay wiping

Fixes duplicate menu selector images with some HDMV discs.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 4e0fa1b4
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment