[vlc-devel] [PATCH] Added libvlc_video_get_spu_delay and, libvlc_video_set_spu_delay.

Jean-Baptiste Kempf jb at videolan.org
Tue Nov 29 17:21:18 CET 2011


On Tue, Nov 29, 2011 at 03:45:01PM +0100, John Hendrikx wrote :
> Allows for controlling the subtitle delay through libvlc.
Thanks.

> include/vlc/libvlc_media_player.h |   19 +++++++++++++++++++
> lib/video.c                       |   32 ++++++++++++++++++++++++++++++++

Missing the .sym file, I think.

> /**
> + * Get current subtitle delay.
> + *
> + * \param p_mi media player
> + * \return the subtitle delay (microseconds)

You should be more clear about what is a delay. Seeing the mess it was
for the UIs, this needs to be more verbos.

> + * \param i_delay the subtitle delay (microseconds)
idem.

> +int64_t libvlc_video_get_spu_delay( libvlc_media_player_t *p_mi )
> +{
> +    input_thread_t *p_input_thread = libvlc_get_input_thread ( p_mi );
> +    int64_t val = 0;
> +
> +    if( p_input_thread )
> +    {
> +        val = var_GetTime( p_input_thread, "spu-delay" );
> +        vlc_object_release( p_input_thread );
> +    }
> +
> +    return val;
> +}
> +
> +int libvlc_video_set_spu_delay( libvlc_media_player_t *p_mi,
> +                                int64_t i_delay )
> +{
> +    input_thread_t *p_input_thread = libvlc_get_input_thread ( p_mi );
> +    int ret = -1;
> +
> +    if( p_input_thread )
> +    {
> +        var_SetTime( p_input_thread, "spu-delay", i_delay );
> +        vlc_object_release( p_input_thread );
> +	ret = 0;

Please avoid tabs in source code.

Else, seems ok.

Best regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device



More information about the vlc-devel mailing list