[vlc-devel] [PATCH] Preliminary dual subtitles support.

Francois Cartegnie fcvlcdev at free.fr
Wed Apr 24 11:43:31 CEST 2019


Le 23/04/2019 à 12:43, Roland Bewick a écrit :

> --- a/modules/codec/subsusf.c
> +++ b/modules/codec/subsusf.c
> @@ -436,12 +436,11 @@ static subpicture_region_t *CreateTextRegion( decoder_t *p_dec,
>              }
>          }
>  
> -        /* Set default or user align/magin.
> +        /* Set default or user align/margin.
>           * Style overriden if no user value. */
>          p_text_region->i_x = i_sys_align > 0 ? 20 : 0;
>          p_text_region->i_y = 10;
> -        p_text_region->i_align = SUBPICTURE_ALIGN_BOTTOM |
> -                                 ((i_sys_align > 0) ? i_sys_align : 0);
> +        p_text_region->i_align = i_sys_align >= 0 ? i_sys_align : SUBPICTURE_ALIGN_BOTTOM;

Unless there's an existing issue, no change here that could break
regular single spu.

>          if( p_ssa_style )
>          {
> diff --git a/src/input/es_out.c b/src/input/es_out.c
> index 3352602849..835975fa1f 100644
> --- a/src/input/es_out.c
> +++ b/src/input/es_out.c
> @@ -142,6 +142,7 @@ typedef struct
>  {
>      int         i_count;    /* es count */
>      es_out_id_t *p_main_es; /* current main es */
> +    es_out_id_t *p_secondary_es; /* current secondary es (SPU_ES only) */
>      enum es_out_policy_e e_policy;
>  
>      /* Parameters used for es selection */
> @@ -300,6 +301,7 @@ static void EsOutPropsInit( es_out_es_props_t *p_props,
>      p_props->i_channel = (psz_trackvar) ? var_GetInteger( p_input, psz_trackvar ): -1;
>      p_props->i_demux_id = -1;
>      p_props->p_main_es = NULL;
> +    p_props->p_secondary_es = NULL;
>  
>      if( !input_priv(p_input)->b_preparsing && psz_langvar )
>      {
> @@ -343,7 +345,7 @@ es_out_t *input_EsOutNew( input_thread_t *p_input, float rate )
>                      "video-track-id", "video-track", NULL, NULL );
>      EsOutPropsInit( &p_sys->audio, true, p_input, ES_OUT_ES_POLICY_EXCLUSIVE,
>                      "audio-track-id", "audio-track", "audio-language", "audio" );
> -    EsOutPropsInit( &p_sys->sub,  false, p_input, ES_OUT_ES_POLICY_EXCLUSIVE,
> +    EsOutPropsInit( &p_sys->sub,  false, p_input, ES_OUT_ES_POLICY_SIMULTANEOUS,
>                      "sub-track-id", "sub-track", "sub-language", "sub" );
>  

changing policy will clearly break all auto deselection by demuxers

-- 
Francois Cartegnie
VideoLAN - VLC Developer


More information about the vlc-devel mailing list