From 360ad2952999d1caaed9aaa0962df47f29cdc7db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C3=ABl=20Carr=C3=A9?= Date: Mon, 12 Aug 2013 15:01:34 +0200 Subject: [PATCH] bluray: add blurayCloseOverlay --- modules/access/bluray.c | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/modules/access/bluray.c b/modules/access/bluray.c index 86b12c7a1a..c87ac3e6db 100644 --- a/modules/access/bluray.c +++ b/modules/access/bluray.c @@ -692,6 +692,21 @@ static void blurayCleanOverlayStruct(bluray_overlay_t *p_overlay) free(p_overlay); } +static void blurayCloseOverlay(demux_t *p_demux, int plane) +{ + demux_sys_t *p_sys = p_demux->p_sys; + bluray_overlay_t *ov = p_sys->p_overlays[plane]; + + if (ov != NULL) { + vout_FlushSubpictureChannel(p_sys->p_vout, ov->p_pic->i_channel); + blurayCleanOverlayStruct(ov); + if (p_sys->current_overlay == plane) + p_sys->current_overlay = -1; + } + + p_sys->p_overlays[plane] = NULL; +} + static void blurayCloseAllOverlays(demux_t *p_demux) { demux_sys_t *p_sys = p_demux->p_sys; @@ -700,14 +715,9 @@ static void blurayCloseAllOverlays(demux_t *p_demux) if (!p_sys->p_vout) return; - for (int i = 0; i < MAX_OVERLAY; i++) { - if (p_sys->p_overlays[i] != NULL) { - vout_FlushSubpictureChannel(p_sys->p_vout, - p_sys->p_overlays[i]->p_pic->i_channel); - blurayCleanOverlayStruct(p_sys->p_overlays[i]); - p_sys->p_overlays[i] = NULL; - } - } + for (int i = 0; i < MAX_OVERLAY; i++) + blurayCloseOverlay(p_demux, i); + var_DelCallback(p_sys->p_vout, "mouse-moved", onMouseEvent, p_demux); var_DelCallback(p_sys->p_vout, "mouse-clicked", onMouseEvent, p_demux); vlc_object_release(p_sys->p_vout); @@ -890,6 +900,10 @@ static void blurayOverlayProc(void *ptr, const BD_OVERLAY *const overlay) msg_Info(p_demux, "Initializing overlay"); blurayInitOverlay(p_demux, overlay->plane, overlay->w, overlay->h); break; + case BD_OVERLAY_CLOSE: + blurayClearOverlay(p_demux, overlay->plane); + blurayCloseOverlay(p_demux, overlay->plane); + break; case BD_OVERLAY_CLEAR: blurayClearOverlay(p_demux, overlay->plane); break; @@ -972,7 +986,7 @@ static void blurayArgbOverlayProc(void *ptr, const BD_ARGB_OVERLAY *const overla break; case BD_ARGB_OVERLAY_CLOSE: blurayClearOverlay(p_demux, overlay->plane); - // TODO: blurayCloseOverlay(p_demux, overlay->plane); + blurayCloseOverlay(p_demux, overlay->plane); break; case BD_ARGB_OVERLAY_FLUSH: blurayActivateOverlay(p_demux, overlay->plane); -- GitLab