#include "input_internal.h"
-#include "vlc_playlist.h"
#include <vlc_iso_lang.h>
/* FIXME we should find a better way than including that */
#include "../text/iso-639_def.h"
*****************************************************************************/
es_out_t *input_EsOutNew( input_thread_t *p_input, int i_rate )
{
- es_out_t *out = malloc( sizeof( es_out_t ) );
- es_out_sys_t *p_sys = malloc( sizeof( es_out_sys_t ) );
vlc_value_t val;
int i;
+ es_out_t *out = malloc( sizeof( es_out_t ) );
if( !out ) return NULL;
+
+ es_out_sys_t *p_sys = malloc( sizeof( es_out_sys_t ) );
if( !p_sys )
{
free( out );
{
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;
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;
}
{
if( psz_language && *psz_language )
{
- char *temp;
- text.psz_string = malloc( strlen( _("Track %i") )+
- strlen( psz_language ) + 30 );
- asprintf( &temp, _("Track %i"), val.i_int );
- sprintf( text.psz_string, "%s - [%s]", temp, psz_language );
- free( temp );
+ if( asprintf( &text.psz_string, "%s %i - [%s]", _( "Track" ), val.i_int, psz_language ) == -1 )
+ text.psz_string = NULL;
}
else
{
- text.psz_string = malloc( strlen( _("Track %i") ) + 20 );
- sprintf( text.psz_string, _("Track %i"), val.i_int );
+ if( asprintf( &text.psz_string, "%s %i", _( "Track" ), val.i_int ) == -1 )
+ text.psz_string = NULL;
}
}
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 );
}
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 )
}
}
{
- /* FIXME: we don't want to depend on the playlist */
- playlist_t * p_playlist = vlc_object_find( p_sys->p_input,
- VLC_OBJECT_PLAYLIST, FIND_PARENT );
- if( p_playlist )
- {
- PL_LOCK;
- p_playlist->gc_date = mdate();
- vlc_object_signal_unlocked( p_playlist );
- PL_UNLOCK;
- vlc_object_release( p_playlist );
- }
+ vlc_event_t event;
+ event.type = vlc_InputSelectedStreamChanged;
+ vlc_event_send( &p_sys->p_input->p->event_manager, &event );
}
return VLC_SUCCESS;