Commit a61cb21f authored by Laurent Aimar's avatar Laurent Aimar

Fixed vout reuse regression.

parent 3fd7fd49
......@@ -53,6 +53,7 @@
typedef struct {
vout_thread_t *vout;
vlc_object_t *input;
bool change_fmt;
const video_format_t *fmt;
unsigned dpb_size;
} vout_configuration_t;
......
......@@ -816,10 +816,11 @@ static vout_thread_t *RequestVout( void *p_private,
aout_instance_t *p_aout = p_private;
VLC_UNUSED(b_recycle);
vout_configuration_t cfg = {
.vout = p_vout,
.input = NULL,
.fmt = p_fmt,
.dpb_size = 1,
.vout = p_vout,
.input = NULL,
.change_fmt = true,
.fmt = p_fmt,
.dpb_size = 1,
};
return vout_Request( p_aout, &cfg );
}
......
......@@ -244,10 +244,11 @@ static vout_thread_t *RequestVout( input_resource_t *p_resource,
/* */
vout_configuration_t cfg = {
.vout = p_vout,
.input = VLC_OBJECT(p_resource->p_input),
.fmt = p_fmt,
.dpb_size = dpb_size,
.vout = p_vout,
.input = VLC_OBJECT(p_resource->p_input),
.change_fmt = true,
.fmt = p_fmt,
.dpb_size = dpb_size,
};
p_vout = vout_Request( p_resource->p_input, &cfg );
if( !p_vout )
......@@ -283,10 +284,11 @@ static vout_thread_t *RequestVout( input_resource_t *p_resource,
vout_FlushSubpictureChannel( p_vout, -1 );
vout_configuration_t cfg = {
.vout = p_vout,
.input = NULL,
.fmt = p_fmt,
.dpb_size = 0,
.vout = p_vout,
.input = NULL,
.change_fmt = false,
.fmt = NULL,
.dpb_size = 0,
};
p_resource->p_vout_free = vout_Request( p_resource->p_input, &cfg );
}
......
......@@ -178,7 +178,7 @@ vout_thread_t *(vout_Request)(vlc_object_t *object,
const vout_configuration_t *cfg)
{
vout_thread_t *vout = cfg->vout;
if (!cfg->fmt) {
if (cfg->change_fmt && !cfg->fmt) {
if (vout)
vout_CloseAndRelease(vout);
return NULL;
......@@ -197,12 +197,15 @@ vout_thread_t *(vout_Request)(vlc_object_t *object,
spu_Attach(vout->p->p_spu, vout->p->input, true);
}
vout_control_cmd_t cmd;
vout_control_cmd_Init(&cmd, VOUT_CONTROL_REINIT);
cmd.u.cfg = cfg;
if (cfg->change_fmt) {
vout_control_cmd_t cmd;
vout_control_cmd_Init(&cmd, VOUT_CONTROL_REINIT);
cmd.u.cfg = cfg;
vout_control_Push(&vout->p->control, &cmd);
vout_control_WaitEmpty(&vout->p->control);
}
vout_control_Push(&vout->p->control, &cmd);
vout_control_WaitEmpty(&vout->p->control);
if (!vout->p->dead) {
msg_Dbg(object, "reusing provided vout");
return vout;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment