Commit f40016bc authored by François Cartegnie's avatar François Cartegnie 🤞

input: resource: emit vout title request once per item

parent 68b27c23
Pipeline #92794 passed with stage
in 18 minutes and 42 seconds
......@@ -49,6 +49,7 @@ struct vout_resource
vout_thread_t *vout;
enum vlc_vout_order order;
bool started;
const void * last_displayed_title_id;
struct vlc_list node;
};
......@@ -107,6 +108,7 @@ vout_resource_Create(vout_thread_t *vout)
return NULL;
vout_rsc->started = false;
vout_rsc->last_displayed_title_id = NULL;
vout_rsc->vout = vout;
return vout_rsc;
}
......@@ -158,16 +160,9 @@ static void DestroyVout( input_resource_t *p_resource )
}
}
static void DisplayVoutTitle( input_resource_t *p_resource,
static void DisplayVoutTitle( input_item_t *p_item,
vout_thread_t *p_vout )
{
if( p_resource->p_input == NULL )
return;
/* TODO display the title only one time for the same input ? */
input_item_t *p_item = input_GetItem( p_resource->p_input );
char *psz_nowplaying = input_item_GetNowPlayingFb( p_item );
if( psz_nowplaying && *psz_nowplaying )
{
......@@ -493,11 +488,17 @@ vout_thread_t *input_resource_RequestVout(input_resource_t *p_resource,
if (has_started != NULL)
*has_started = true;
DisplayVoutTitle(p_resource, cfg->vout);
/* Send original viewpoint to the input in order to update other ESes */
if (p_resource->p_input != NULL)
{
/* Trigger title display once per start */
input_item_t *p_item = input_GetItem(p_resource->p_input);
if(p_item != vout_rsc->last_displayed_title_id)
{
DisplayVoutTitle(p_item, cfg->vout);
vout_rsc->last_displayed_title_id = p_item;
}
/* Send original viewpoint to the input in order to update other ESes */
input_control_param_t param = { .viewpoint = cfg->fmt->pose };
input_ControlPush(p_resource->p_input, INPUT_CONTROL_SET_INITIAL_VIEWPOINT,
&param);
......
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