[vlc-devel] [PATCH 3/5] video_output: don't require an enabled window to create the decoder device

Steve Lhomme robux4 at ycbcr.xyz
Wed Jan 22 11:44:03 CET 2020


So we can create the vout thread and the decoder device without knowing the
actual display dimensions that will be used.

The vout always has a usable window, even if it's not enabled.
---
 src/input/decoder.c             |  9 ---------
 src/video_output/video_output.c | 13 +------------
 2 files changed, 1 insertion(+), 21 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 17a36df3c9b..480fa6bd17c 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -550,15 +550,6 @@ static int CreateVoutIfNeeded(struct decoder_owner *p_owner,
         return 0; // vout unchanged
     }
 
-    if( !p_dec->fmt_out.video.i_width ||
-        !p_dec->fmt_out.video.i_height ||
-        p_dec->fmt_out.video.i_width < p_dec->fmt_out.video.i_visible_width ||
-        p_dec->fmt_out.video.i_height < p_dec->fmt_out.video.i_visible_height )
-    {
-        /* Can't create a new vout without display size */
-        return -1;
-    }
-
     vlc_mutex_lock( &p_owner->lock );
 
     vout_thread_t *p_vout = p_owner->p_vout;
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 30ac43c694b..83a773e916b 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -2097,23 +2097,12 @@ vlc_decoder_device *vout_GetDevice(const vout_device_configuration_t *cfg)
 {
     vlc_decoder_device *dec_device = NULL;
 
-    assert(cfg->fmt != NULL);
     vout_thread_sys_t *sys = cfg->vout->p;
 
-    if (!VoutCheckFormat(cfg->fmt))
-        return NULL;
-
-    video_format_t original;
-    VoutFixFormat(&original, cfg->fmt);
-
     vlc_mutex_lock(&sys->window_lock);
-    int res = EnableWindowLocked(cfg->vout, &original);
-    if (res == 0 && sys->dec_device == NULL)
+    if (sys->dec_device == NULL)
         sys->dec_device = vlc_decoder_device_Create(&cfg->vout->obj, sys->display_cfg.window);
     dec_device = sys->dec_device ? vlc_decoder_device_Hold( sys->dec_device ) : NULL;
     vlc_mutex_unlock(&sys->window_lock);
-    video_format_Clean(&original);
-    if (res != 0)
-        return NULL;
     return dec_device;
 }
-- 
2.17.1



More information about the vlc-devel mailing list