static void SlaveSeek( input_thread_t *p_input );
static void InputMetaUser( input_thread_t *p_input, vlc_meta_t *p_meta );
-static void InputUpdateMeta( input_thread_t *p_input, vlc_meta_t *p_meta );
+static void InputUpdateMeta( input_thread_t *p_input, demux_t *p_demux );
static void InputGetExtraFiles( input_thread_t *p_input,
int *pi_list, char ***pppsz_list,
const char *psz_access, const char *psz_path );
{
char *prgms;
- if( var_GetBool( p_input, "sout-all" ) )
- {
- i_es_out_mode = ES_OUT_MODE_ALL;
- }
- else
if( (prgms = var_GetNonEmptyString( p_input, "programs" )) != NULL )
{
char *buf;
free( prgms );
}
+ else if( var_GetBool( p_input, "sout-all" ) )
+ {
+ i_es_out_mode = ES_OUT_MODE_ALL;
+ }
}
es_out_SetMode( p_input->p->p_es_out, i_es_out_mode );
static int Init( input_thread_t * p_input )
{
- vlc_meta_t *p_meta;
-
for( int i = 0; i < p_input->p->p_item->i_options; i++ )
{
if( !strncmp( p_input->p->p_item->ppsz_options[i], "meta-file", 9 ) )
p_input->p->b_out_pace_control ? "async" : "sync" );
}
- p_meta = vlc_meta_New();
- if( p_meta )
+ vlc_meta_t *p_meta = vlc_meta_New();
+ if( p_meta != NULL )
{
/* Get meta data from users */
InputMetaUser( p_input, p_meta );
for( int i = 0; i < p_input->p->i_slave; i++ )
InputSourceMeta( p_input, p_input->p->slave[i], p_meta );
- /* */
- InputUpdateMeta( p_input, p_meta );
+ es_out_ControlSetMeta( p_input->p->p_es_out, p_meta );
+ vlc_meta_Delete( p_meta );
}
msg_Dbg( p_input, "`%s' successfully opened",
if( slave && !InputSourceInit( p_input, slave, uri, NULL, false ) )
{
- vlc_meta_t *p_meta;
int64_t i_time;
/* Add the slave */
}
/* Get meta (access and demux) */
- p_meta = vlc_meta_New();
- if( p_meta )
- {
- demux_Control( slave->p_demux, DEMUX_GET_META, p_meta );
- InputUpdateMeta( p_input, p_meta );
- }
+ InputUpdateMeta( p_input, slave->p_demux );
TAB_APPEND( p_input->p->i_slave, p_input->p->slave, slave );
}
if( p_demux->info.i_update & INPUT_UPDATE_META )
{
- vlc_meta_t *p_meta = vlc_meta_New();
- if( p_meta )
- {
- demux_Control( p_input->p->input.p_demux, DEMUX_GET_META, p_meta );
- InputUpdateMeta( p_input, p_meta );
- }
+ InputUpdateMeta( p_input, p_demux );
p_demux->info.i_update &= ~INPUT_UPDATE_META;
}
{
* InputUpdateMeta: merge p_item meta data with p_meta taking care of
* arturl and locking issue.
*****************************************************************************/
-static void InputUpdateMeta( input_thread_t *p_input, vlc_meta_t *p_meta )
+static void InputUpdateMeta( input_thread_t *p_input, demux_t *p_demux )
{
+ vlc_meta_t *p_meta = vlc_meta_New();
+ if( unlikely(p_meta == NULL) )
+ return;
+
+ demux_Control( p_demux, DEMUX_GET_META, p_meta );
+
/* If metadata changed, then the attachments might have changed.
We need to update them in case they contain album art. */
- input_source_t *in = &p_input->p->input;
- int i_attachment;
input_attachment_t **attachment;
- if( !demux_Control( in->p_demux, DEMUX_GET_ATTACHMENTS,
- &attachment, &i_attachment ) )
+ int i_attachment;
+
+ if( !demux_Control( p_demux, DEMUX_GET_ATTACHMENTS,
+ &attachment, &i_attachment ) )
{
vlc_mutex_lock( &p_input->p->p_item->lock );
if( p_input->p->i_attachment > 0 )
i_attachment, attachment );
vlc_mutex_unlock( &p_input->p->p_item->lock );
}
+
es_out_ControlSetMeta( p_input->p->p_es_out, p_meta );
vlc_meta_Delete( p_meta );
}