[vlc-devel] [PATCH 41/42] video_output: enable the window using only the vout
Steve Lhomme
robux4 at ycbcr.xyz
Wed Oct 16 16:59:16 CEST 2019
We don't need a full vout_configuration_t for that, only the vout object and the
video_format_t to initialize the window size.
---
src/video_output/video_output.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 86e18b14d5a..cc2a407fa98 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1972,15 +1972,13 @@ int vout_ChangeSource( vout_thread_t *vout, const video_format_t *original, unsi
return -1;
}
-static int vout_EnableWindow(const vout_configuration_t *cfg, const video_format_t *original,
+static int vout_EnableWindow(vout_thread_t *vout, const video_format_t *original,
vlc_decoder_device **pp_dec_device)
{
- vout_thread_t *vout = cfg->vout;
vout_thread_sys_t *sys = vout->p;
assert(!sys->dummy);
assert(vout != NULL);
- assert(cfg->clock != NULL);
vlc_mutex_lock(&sys->window_lock);
if (!sys->window_enabled) {
@@ -2022,6 +2020,7 @@ int vout_Request(const vout_configuration_t *cfg, vlc_video_context *vctx, input
vout_thread_sys_t *sys = vout->p;
assert(cfg->fmt != NULL);
+ assert(cfg->clock != NULL);
if (!VoutCheckFormat(cfg->fmt))
/* don't stop the display and keep sys->original */
@@ -2036,7 +2035,7 @@ int vout_Request(const vout_configuration_t *cfg, vlc_video_context *vctx, input
return 0;
}
- if (vout_EnableWindow(cfg, &original, NULL) != 0)
+ if (vout_EnableWindow(cfg->vout, &original, NULL) != 0)
{
/* the window was not enabled, nor the display started */
msg_Err(vout, "failed to enable window");
@@ -2087,7 +2086,7 @@ vlc_decoder_device *vout_GetDevice(const vout_configuration_t *cfg)
video_format_t original;
VoutFixFormat(&original, cfg->fmt);
- int res = vout_EnableWindow(cfg, &original, &dec_device);
+ int res = vout_EnableWindow(cfg->vout, &original, &dec_device);
video_format_Clean(&original);
if (res != 0)
return NULL;
--
2.17.1
More information about the vlc-devel
mailing list