Commit 45ee8540 authored by Laurent Aimar's avatar Laurent Aimar
Browse files

Added a "meta-preparsed" input variable. A demuxer can test it by

 var_CreateGetBool( p_demux, "meta-preparsed" )
(The demuxer should NOT overwrite it)
subtitle: do not look for p_input when not necessary.
parent ea06273f
......@@ -176,7 +176,6 @@ static int Open ( vlc_object_t *p_this )
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys;
es_format_t fmt;
input_thread_t *p_input;
float f_fps;
char *psz_type;
int (*pf_read)( demux_t *, subtitle_t* );
......@@ -198,16 +197,11 @@ static int Open ( vlc_object_t *p_this )
p_sys->i_microsecperframe = 40000;
/* Get the FPS */
p_input = (input_thread_t *)vlc_object_find( p_demux, VLC_OBJECT_INPUT, FIND_PARENT );
if( p_input )
{
f_fps = var_GetFloat( p_input, "sub-original-fps" );
if( f_fps >= 1.0 )
p_sys->i_microsecperframe = (int64_t)( (float)1000000 / f_fps );
f_fps = var_CreateGetFloat( p_demux, "sub-original-fps" );
if( f_fps >= 1.0 )
p_sys->i_microsecperframe = (int64_t)( (float)1000000 / f_fps );
msg_Dbg( p_demux, "Movie fps: %f", f_fps );
vlc_object_release( p_input );
}
msg_Dbg( p_demux, "Movie fps: %f", f_fps );
/* Check for override of the fps */
f_fps = var_CreateGetFloat( p_demux, "sub-fps" );
......
......@@ -196,6 +196,12 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
/* Create Object Variables for private use only */
input_ConfigVarInit( p_input );
vlc_mutex_lock( &p_item->lock );
if( p_item->p_meta && (p_item->p_meta->i_status & ITEM_PREPARSED ) )
var_SetBool( p_input, "meta-preparsed", VLC_TRUE );
vlc_mutex_unlock( &p_item->lock );
/* Create Objects variables for public Get and Set */
input_ControlVarInit( p_input );
......
......@@ -463,6 +463,9 @@ void input_ConfigVarInit ( input_thread_t *p_input )
var_Create( p_input, "meta-description", VLC_VAR_STRING|VLC_VAR_DOINHERIT);
var_Create( p_input, "meta-date", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
var_Create( p_input, "meta-url", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
var_Create( p_input, "meta-preparsed", VLC_VAR_BOOL );
var_SetBool( p_input, "meta-preparsed", VLC_FALSE );
}
/*****************************************************************************
......
Supports Markdown
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