# include "config.h"
#endif
-#include <vlc/vlc.h>
+#include <vlc_common.h>
#include <stdio.h>
#include "input_internal.h"
-#include "vlc_playlist.h"
-#include "iso_lang.h"
+#include <vlc_iso_lang.h>
/* FIXME we should find a better way than including that */
#include "../text/iso-639_def.h"
vlc_value_t val;
int i;
+ if( !out ) return NULL;
+ if( !p_sys )
+ {
+ free( out );
+ return NULL;
+ }
+
out->pf_add = EsOutAdd;
out->pf_send = EsOutSend;
out->pf_del = EsOutDel;
out->pf_control = EsOutControl;
out->p_sys = p_sys;
- out->b_sout = (p_input->p->p_sout != NULL ? true : false);
+ out->b_sout = p_input->p->p_sout != NULL;
p_sys->p_input = p_input;
{
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;
}
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 )
vlc_value_t val;
es_out_pgrm_t *p_pgrm = malloc( sizeof( es_out_pgrm_t ) );
+ if( !p_pgrm ) return NULL;
/* Init */
p_pgrm->i_id = i_group;
es_out_pgrm_t *p_pgrm = NULL;
int i;
+ if( !es ) return NULL;
+
if( fmt->i_group < 0 )
{
msg_Err( p_input, "invalid group number" );
+ free( es );
return NULL;
}
{
if( es->fmt.i_cat == VIDEO_ES || es->fmt.i_cat == SPU_ES )
{
- if( !var_GetBool( p_input, "video" ) ||
- ( p_input->p->p_sout && !var_GetBool( p_input, "sout-video" ) ) )
+ if( !var_GetBool( p_input, out->b_sout ? "sout-video" : "video" ) )
{
msg_Dbg( p_input, "video is disabled, not selecting ES 0x%x",
es->i_id );
else if( es->fmt.i_cat == AUDIO_ES )
{
var_Get( p_input, "audio", &val );
- if( !var_GetBool( p_input, "audio" ) ||
- ( p_input->p->p_sout && !var_GetBool( p_input, "sout-audio" ) ) )
+ if( !var_GetBool( p_input, out->b_sout ? "sout-audio" : "audio" ) )
{
msg_Dbg( p_input, "audio is disabled, not selecting ES 0x%x",
es->i_id );
if( es->fmt.i_cat == SPU_ES )
{
var_Get( p_input, "spu", &val );
- if( !var_GetBool( p_input, "spu" ) ||
- ( p_input->p->p_sout && !var_GetBool( p_input, "sout-spu" ) ) )
+ if( !var_GetBool( p_input, out->b_sout ? "sout-spu" : "spu" ) )
{
msg_Dbg( p_input, "spu is disabled, not selecting ES 0x%x",
es->i_id );
else
i_delay = 0;
- if( p_input->p_libvlc->b_stats )
+ if( libvlc_stats (p_input) )
{
vlc_mutex_lock( &p_input->p->counters.counters_lock );
stats_UpdateInteger( p_input, p_input->p->counters.p_demux_read,
p_block->i_pts =
input_ClockGetTS( p_input, &p_pgrm->clock, p_block->i_pts ) + i_delay;
}
- if ( es->fmt.i_codec == VLC_FOURCC( 't', 'e', 'l', 'x' ) )
+ if ( p_block->i_rate == INPUT_RATE_DEFAULT &&
+ es->fmt.i_codec == VLC_FOURCC( 't', 'e', 'l', 'x' ) )
{
mtime_t current_date = mdate();
if( !p_block->i_pts
VLC_FOURCC('c', 'c', '3', ' '),
VLC_FOURCC('c', 'c', '4', ' '),
};
- static const char *ppsz_description[4] = {
+ static const char ppsz_description[4][18] = {
N_("Closed captions 1"),
N_("Closed captions 2"),
N_("Closed captions 3"),
}
}
{
- /* 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;
fmt->video.i_frame_rate_base * 1000000,
1000000 );
input_Control( p_input, INPUT_ADD_INFO, psz_cat,
- _("Frame rate"), I64Fd".%06u",
+ _("Frame rate"), "%"PRId64".%06u",
div.quot, (unsigned int )div.rem );
}
break;