[vlc-devel] [PATCH 1/2] hotkeys: Delay subtitle track only if it exists and is enabled.

Jean-Baptiste Kempf jb at videolan.org
Sat Apr 13 19:47:15 CEST 2013


On 10 Apr, Zoran Turalija wrote :
> In ACTIONID_SUBDELAY_UP/DOWN, do not delay subtitle if there is none,
> or if subtitle has been currently disabled.
> ---
>  modules/control/hotkeys.c |   14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
> index 95bc0d0..2325c92 100644
> --- a/modules/control/hotkeys.c
> +++ b/modules/control/hotkeys.c
> @@ -374,6 +374,20 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
>              int diff = (i_action == ACTIONID_SUBDELAY_UP) ? 50000 : -50000;
>              if( p_input )
>              {
> +                vlc_value_t val, list, list2;
> +                int i_count;
> +                var_Get( p_input, "spu-es", &val );
> +
> +                var_Change( p_input, "spu-es", VLC_VAR_GETCHOICES,
> +                            &list, &list2 );
> +                i_count = list.p_list->i_count;
> +                if( i_count < 1 || val.i_int < 0 )
> +                {
> +                    DisplayMessage( p_vout, _("Delay not set; subtitle track: %s"),
> +                                    vlc_gettext( i_count ? N_("Disabled") : N_("N/A") ) );
> +                    var_FreeList( &list, &list2 );
> +                    break;
> +                }

You var_FreeList only in the if, but not in the rest of the cases?

Isn't the message a bit too complex?

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