[vlc-devel] [RFC PATCH] accesstweaks: add force-cache option

Thomas Guillem thomas at gllm.fr
Thu Oct 22 09:32:25 CEST 2015


Rémi, do you mean something like that ?

On Thu, Oct 22, 2015, at 09:31, Thomas Guillem wrote:
> ---
>  modules/stream_filter/accesstweaks.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/modules/stream_filter/accesstweaks.c
> b/modules/stream_filter/accesstweaks.c
> index c373981..2a7d10d 100644
> --- a/modules/stream_filter/accesstweaks.c
> +++ b/modules/stream_filter/accesstweaks.c
> @@ -46,6 +46,8 @@ vlc_module_begin ()
>          change_volatile ()
>      add_bool ("fastseek", true, "forces result of the CAN_FASTSEEK
>      control", NULL, false)
>          change_volatile ()
> +    add_string ("force-cache", NULL, "force stream-filter cache", NULL,
> false)
> +        change_volatile ()
>      add_shortcut("tweaks")
>  vlc_module_end ()
>  
> @@ -114,6 +116,22 @@ static int Open( vlc_object_t *p_object )
>      p_stream->pf_seek = p_sys->b_seek ? Seek : NULL;
>      p_stream->pf_control = Control;
>  
> +    char *p_force_cache = var_InheritString( p_stream, "force-cache" );
> +    if( p_force_cache && *p_force_cache )
> +    {
> +        stream_t *p_new = stream_FilterNew( p_stream->p_source,
> p_force_cache );
> +        free( p_force_cache );
> +
> +        if( !p_new )
> +        {
> +            free( p_sys );
> +            return VLC_EGENERIC;
> +        }
> +        else
> +            p_stream->p_source = p_new;
> +    }
> +
> +
>      return VLC_SUCCESS;
>  }
>  
> -- 
> 2.1.4
> 


More information about the vlc-devel mailing list