[vlc-devel] [PATCH] decoder: remove the size requirement to create a vout

Steve Lhomme robux4 at ycbcr.xyz
Mon Jan 13 10:34:38 CET 2020


In some cases (nvdec, mmal, mediacodec ?) the actual size of the video to
decode is known only after data have been processed, long after the device
is setup to use with this API. There are hacks to try to guess the size early
but in the end it's just a hack.

It's not necessary to know the size of the video when creating the vout. It's
only needed by VDPAU and maybe VAAPI because they need a real window. These
already provide the proper size when requesting the decoder device, they are
requested when lavc has already processed some data.
---
 src/input/decoder.c | 9 ---------
 1 file changed, 9 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;
-- 
2.17.1



More information about the vlc-devel mailing list