[vlc-commits] video_output: don't let the display module deal with subpicture release
Steve Lhomme
git at videolan.org
Sat Oct 27 08:35:56 CEST 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Sat Oct 27 08:25:25 2018 +0200| [bdd0be7c5645407416893b4ad6aebcffcc8601d8] | committer: Steve Lhomme
video_output: don't let the display module deal with subpicture release
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bdd0be7c5645407416893b4ad6aebcffcc8601d8
---
modules/hw/mmal/vout.c | 3 ---
modules/hw/vdpau/display.c | 6 +-----
modules/video_output/android/display.c | 4 +---
modules/video_output/caopengllayer.m | 4 +---
modules/video_output/ios.m | 4 +---
modules/video_output/macosx.m | 4 +---
modules/video_output/opengl/display.c | 4 +---
modules/video_output/win32/direct3d11.c | 3 +--
modules/video_output/win32/direct3d9.c | 7 +------
modules/video_output/win32/glwin32.c | 3 +--
src/video_output/vout_wrapper.h | 2 ++
11 files changed, 11 insertions(+), 33 deletions(-)
diff --git a/modules/hw/mmal/vout.c b/modules/hw/mmal/vout.c
index b9ca560eeb..2a83045522 100644
--- a/modules/hw/mmal/vout.c
+++ b/modules/hw/mmal/vout.c
@@ -595,9 +595,6 @@ static void vd_display(vout_display_t *vd, picture_t *picture,
display_subpicture(vd, subpicture);
- if (subpicture)
- subpicture_Delete(subpicture);
-
if (sys->next_phase_check == 0 && sys->adjust_refresh_rate)
maintain_phase_sync(vd);
sys->next_phase_check = (sys->next_phase_check + 1) % PHASE_CHECK_INTERVAL;
diff --git a/modules/hw/vdpau/display.c b/modules/hw/vdpau/display.c
index f470c47b40..a249b0b3ae 100644
--- a/modules/hw/vdpau/display.c
+++ b/modules/hw/vdpau/display.c
@@ -294,6 +294,7 @@ static void Queue(vout_display_t *vd, picture_t *pic, subpicture_t *subpic,
static void Wait(vout_display_t *vd, picture_t *pic, subpicture_t *subpicture)
{
vout_display_sys_t *sys = vd->sys;
+ VLC_UNUSED(subpicture);
picture_t *current = sys->current;
if (current != NULL)
@@ -315,11 +316,6 @@ static void Wait(vout_display_t *vd, picture_t *pic, subpicture_t *subpicture)
sys->current = picture_Hold(pic);
out:
- /* We already dealt with the subpicture in the Queue phase, so it's safe to
- delete at this point */
- if (subpicture)
- subpicture_Delete(subpicture);
-
/* Drain the event queue. TODO: remove sys->conn completely */
xcb_generic_event_t *ev;
diff --git a/modules/video_output/android/display.c b/modules/video_output/android/display.c
index 9c5e51ffc3..521ed4e333 100644
--- a/modules/video_output/android/display.c
+++ b/modules/video_output/android/display.c
@@ -1005,6 +1005,7 @@ static void Display(vout_display_t *vd, picture_t *picture,
{
vout_display_sys_t *sys = vd->sys;
VLC_UNUSED(picture);
+ VLC_UNUSED(subpicture);
if (sys->p_window->b_opaque)
AndroidOpaquePicture_Release(picture->p_sys, true);
@@ -1014,9 +1015,6 @@ static void Display(vout_display_t *vd, picture_t *picture,
if (sys->p_sub_pic)
AndroidWindow_UnlockPicture(sys, sys->p_sub_window, sys->p_sub_pic);
- if (subpicture)
- subpicture_Delete(subpicture);
-
sys->b_displayed = true;
}
diff --git a/modules/video_output/caopengllayer.m b/modules/video_output/caopengllayer.m
index c49f967264..09632c3911 100644
--- a/modules/video_output/caopengllayer.m
+++ b/modules/video_output/caopengllayer.m
@@ -299,6 +299,7 @@ static void PictureDisplay (vout_display_t *vd, picture_t *pic, subpicture_t *su
{
vout_display_sys_t *sys = vd->sys;
VLC_UNUSED(pic);
+ VLC_UNUSED(subpicture);
@synchronized (sys->cgLayer) {
sys->b_frame_available = YES;
@@ -309,9 +310,6 @@ static void PictureDisplay (vout_display_t *vd, picture_t *pic, subpicture_t *su
[sys->cgLayer display];
[CATransaction flush];
}
-
- if (subpicture)
- subpicture_Delete(subpicture);
}
static int Control (vout_display_t *vd, int query, va_list ap)
diff --git a/modules/video_output/ios.m b/modules/video_output/ios.m
index d7aa392a04..975db62043 100644
--- a/modules/video_output/ios.m
+++ b/modules/video_output/ios.m
@@ -302,15 +302,13 @@ static void PictureDisplay(vout_display_t *vd, picture_t *pic, subpicture_t *sub
vout_display_sys_t *sys = vd->sys;
struct gl_sys *glsys = sys->gl->sys;
VLC_UNUSED(pic);
+ VLC_UNUSED(subpicture);
if (vlc_gl_MakeCurrent(sys->gl) == VLC_SUCCESS)
{
vout_display_opengl_Display(glsys->vgl, &vd->source);
vlc_gl_ReleaseCurrent(sys->gl);
}
-
- if (subpicture)
- subpicture_Delete(subpicture);
}
static void PictureRender(vout_display_t *vd, picture_t *pic, subpicture_t *subpicture,
diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index 93172ac95c..767d9dd660 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -335,6 +335,7 @@ static void PictureDisplay (vout_display_t *vd, picture_t *pic, subpicture_t *su
{
vout_display_sys_t *sys = vd->sys;
VLC_UNUSED(pic);
+ VLC_UNUSED(subpicture);
[sys->glView setVoutFlushing:YES];
if (vlc_gl_MakeCurrent(sys->gl) == VLC_SUCCESS)
{
@@ -343,9 +344,6 @@ static void PictureDisplay (vout_display_t *vd, picture_t *pic, subpicture_t *su
}
[sys->glView setVoutFlushing:NO];
sys->has_first_frame = true;
-
- if (subpicture)
- subpicture_Delete(subpicture);
}
static int Control (vout_display_t *vd, int query, va_list ap)
diff --git a/modules/video_output/opengl/display.c b/modules/video_output/opengl/display.c
index a0dd3f74c3..eb53105c55 100644
--- a/modules/video_output/opengl/display.c
+++ b/modules/video_output/opengl/display.c
@@ -209,15 +209,13 @@ static void PictureDisplay (vout_display_t *vd, picture_t *pic, subpicture_t *su
{
vout_display_sys_t *sys = vd->sys;
VLC_UNUSED(pic);
+ VLC_UNUSED(subpicture);
if (vlc_gl_MakeCurrent (sys->gl) == VLC_SUCCESS)
{
vout_display_opengl_Display (sys->vgl, &vd->source);
vlc_gl_ReleaseCurrent (sys->gl);
}
-
- if (subpicture)
- subpicture_Delete(subpicture);
}
static int Control (vout_display_t *vd, int query, va_list ap)
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index d4e0fcc24c..d2ce80a22e 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -972,6 +972,7 @@ static void Display(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
{
vout_display_sys_t *sys = vd->sys;
VLC_UNUSED(picture);
+ VLC_UNUSED(subpicture);
DXGI_PRESENT_PARAMETERS presentParams;
memset(&presentParams, 0, sizeof(presentParams));
@@ -983,8 +984,6 @@ static void Display(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
msg_Err(vd, "SwapChain Present failed. (hr=0x%lX)", hr);
}
d3d11_device_unlock( &sys->d3d_dev );
- if (subpicture)
- subpicture_Delete(subpicture);
CommonDisplay(vd);
}
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index 43f9a10601..2705df0074 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -584,11 +584,8 @@ static void Display(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
const d3d9_device_t *p_d3d9_dev = &sys->d3d_dev;
VLC_UNUSED(subpicture);
- if (sys->lost_not_ready) {
- if (subpicture)
- subpicture_Delete(subpicture);
+ if (sys->lost_not_ready)
return;
- }
// Present the back buffer contents to the display
// No stretching should happen here !
@@ -608,8 +605,6 @@ static void Display(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
/* XXX See Prepare() */
if ( !is_d3d9_opaque(picture->format.i_chroma) )
Direct3D9LockSurface(picture);
- if (subpicture)
- subpicture_Delete(subpicture);
CommonDisplay(vd);
}
diff --git a/modules/video_output/win32/glwin32.c b/modules/video_output/win32/glwin32.c
index 2740debf5f..681232667d 100644
--- a/modules/video_output/win32/glwin32.c
+++ b/modules/video_output/win32/glwin32.c
@@ -232,14 +232,13 @@ static void Display(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
{
vout_display_sys_t *sys = vd->sys;
VLC_UNUSED(picture);
+ VLC_UNUSED(subpicture);
if (vlc_gl_MakeCurrent (sys->gl) == VLC_SUCCESS)
{
vout_display_opengl_Display (sys->vgl, &vd->source);
vlc_gl_ReleaseCurrent (sys->gl);
}
- if (subpicture)
- subpicture_Delete(subpicture);
CommonDisplay(vd);
}
diff --git a/src/video_output/vout_wrapper.h b/src/video_output/vout_wrapper.h
index d560549efc..2cb0681d8f 100644
--- a/src/video_output/vout_wrapper.h
+++ b/src/video_output/vout_wrapper.h
@@ -57,6 +57,8 @@ static inline void vout_display_Display(vout_display_t *vd,
{
vd->display(vd, picture, subpicture);
picture_Release(picture);
+ if (subpicture)
+ subpicture_Delete(subpicture);
}
/**
More information about the vlc-commits
mailing list