]> git.sesse.net Git - vlc/commitdiff
Added input "teletext-es" variable to ease teletext support from
authorLaurent Aimar <fenrir@videolan.org>
Sun, 13 Jul 2008 15:04:17 +0000 (17:04 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Sun, 13 Jul 2008 15:04:17 +0000 (17:04 +0200)
interface.
(This variable will contain the id of spu-es that is teletext or -1 if
not present)

src/input/es_out.c
src/input/input.c
src/input/var.c

index f25f545dafbf18c1cbc3ff21b82b07602b8b912f..24bd6ba06e8d0d923f77dbe642cc74f6255486b1 100644 (file)
@@ -422,6 +422,7 @@ static void EsOutESVarUpdateGeneric( es_out_t *out, int i_id, es_format_t *fmt,
 {
     es_out_sys_t      *p_sys = out->p_sys;
     input_thread_t    *p_input = p_sys->p_input;
+    const  bool b_teletext = fmt->i_cat == SPU_ES && fmt->i_codec == VLC_FOURCC( 't', 'e', 'l', 'x' );
     vlc_value_t       val, text;
 
     const char *psz_var;
@@ -437,8 +438,12 @@ static void EsOutESVarUpdateGeneric( es_out_t *out, int i_id, es_format_t *fmt,
 
     if( b_delete )
     {
+        if( b_teletext )
+            var_SetInteger( p_sys->p_input, "teletext-es", -1 );
+
         val.i_int = i_id;
         var_Change( p_input, psz_var, VLC_VAR_DELCHOICE, &val, NULL );
+
         var_SetBool( p_sys->p_input, "intf-change", true );
         return;
     }
@@ -490,6 +495,9 @@ static void EsOutESVarUpdateGeneric( es_out_t *out, int i_id, es_format_t *fmt,
 
     free( text.psz_string );
 
+    if( b_teletext )
+        var_SetInteger( p_sys->p_input, "teletext-es", i_id );
+
     var_SetBool( p_sys->p_input, "intf-change", true );
 }
 
@@ -550,6 +558,7 @@ static void EsOutProgramSelect( es_out_t *out, es_out_pgrm_t *p_pgrm )
     var_Change( p_input, "audio-es", VLC_VAR_CLEARCHOICES, NULL, NULL );
     var_Change( p_input, "video-es", VLC_VAR_CLEARCHOICES, NULL, NULL );
     var_Change( p_input, "spu-es",   VLC_VAR_CLEARCHOICES, NULL, NULL );
+    var_SetInteger( p_input, "teletext-es", -1 );
     for( i = 0; i < p_sys->i_es; i++ )
     {
         if( p_sys->es[i]->p_pgrm == p_sys->p_pgrm )
index d23cd4f13bceb543c2fb8b68a95c83cee88c3433..7ce4c94136684629ad0c8823e1f4c36357ecb032 100644 (file)
@@ -112,6 +112,7 @@ static void AppendAttachment( int *pi_attachment, input_attachment_t ***ppp_atta
  *  - seekable (if you can seek, it doesn't say if 'bar display' has be shown
  *    or not, for that check position != 0.0)
  *  - can-pause
+ *  - teletext-es to get the index of spu track that is teletext --1 if no teletext)
  * * For intf callback upon changes
  *  - intf-change
  *  - rate-change for when playback rate changes
index afdc1c6771bcd58d76c0aea636d589a53ebc2ef1..1dbba725ebf7cd568a027a6ec6c2bf198f8bdca3 100644 (file)
@@ -462,6 +462,8 @@ void input_ConfigVarInit ( input_thread_t *p_input )
     var_Create( p_input, "can-pause", VLC_VAR_BOOL );
     val.b_bool = true; /* Fixed later*/
     var_Change( p_input, "can-pause", VLC_VAR_SETVALUE, &val, NULL );
+    var_Create( p_input, "teletext-es", VLC_VAR_INTEGER );
+    var_SetInteger( p_input, "teletext-es", -1 );
 
     /* */
     var_Create( p_input, "access-filter", VLC_VAR_STRING | VLC_VAR_DOINHERIT );