[vlc-commits] video_output: don't require an enabled window to create the decoder device

Steve Lhomme git at videolan.org
Fri Jan 24 08:00:13 CET 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jan 22 11:15:02 2020 +0100| [2210c192db61ca479024e4959c386a2c31ce693f] | committer: Steve Lhomme

video_output: don't require an enabled window to create the decoder device

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.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2210c192db61ca479024e4959c386a2c31ce693f
---

 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 dfa1ceb409..840cda64bd 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 30ac43c694..83a773e916 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;
 }



More information about the vlc-commits mailing list