[vlc-devel] [PATCH 12/31] decoder: only get the DPB size before creating the display
Steve Lhomme
robux4 at ycbcr.xyz
Mon Sep 23 17:01:17 CEST 2019
For now the display still holds the picture pool.
---
src/input/decoder.c | 44 ++++++++++++++++++++++----------------------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/src/input/decoder.c b/src/input/decoder.c
index 01705c7a77e..3d7f6c1bbe1 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -543,37 +543,37 @@ static int ModuleThread_UpdateVideoFormat( decoder_t *p_dec )
p_owner->p_vout = NULL; // the DecoderThread should not use the old vout anymore
vlc_mutex_unlock( &p_owner->lock );
- unsigned dpb_size;
- switch( p_dec->fmt_in.i_codec )
- {
- case VLC_CODEC_HEVC:
- case VLC_CODEC_H264:
- case VLC_CODEC_DIRAC: /* FIXME valid ? */
- dpb_size = 18;
- break;
- case VLC_CODEC_AV1:
- dpb_size = 10;
- break;
- case VLC_CODEC_VP5:
- case VLC_CODEC_VP6:
- case VLC_CODEC_VP6F:
- case VLC_CODEC_VP8:
- dpb_size = 3;
- break;
- default:
- dpb_size = 2;
- break;
- }
enum vlc_vout_order order;
vlc_decoder_device *dec_dev = NULL;
vout_configuration_t cfg = {
.vout = p_vout, .clock = p_owner->p_clock, .fmt = &fmt,
- .dpb_size = dpb_size + p_dec->i_extra_picture_buffers + 1,
.mouse_event = MouseEvent, .mouse_opaque = p_dec
};
p_vout = input_resource_GetVoutHoldDevice( p_owner->p_resource, &cfg, &order, &dec_dev );
if (p_vout)
{
+ unsigned dpb_size;
+ switch( p_dec->fmt_in.i_codec )
+ {
+ case VLC_CODEC_HEVC:
+ case VLC_CODEC_H264:
+ case VLC_CODEC_DIRAC: /* FIXME valid ? */
+ dpb_size = 18;
+ break;
+ case VLC_CODEC_AV1:
+ dpb_size = 10;
+ break;
+ case VLC_CODEC_VP5:
+ case VLC_CODEC_VP6:
+ case VLC_CODEC_VP6F:
+ case VLC_CODEC_VP8:
+ dpb_size = 3;
+ break;
+ default:
+ dpb_size = 2;
+ break;
+ }
+ cfg.dpb_size = dpb_size + p_dec->i_extra_picture_buffers + 1,
cfg.vout = p_vout;
if (input_resource_GetDisplay( p_owner->p_resource, &cfg) != 0)
{
--
2.17.1
More information about the vlc-devel
mailing list