if( i_stream_duration <= i_buffering_duration && !b_forced )
{
- const double f_level = (double)i_stream_duration / i_buffering_duration;
+ const double f_level = __MAX( (double)i_stream_duration / i_buffering_duration, 0 );
input_SendEventCache( p_sys->p_input, f_level );
msg_Dbg( p_sys->p_input, "Buffering %d%%", (int)(100 * f_level) );
char **ppsz_all_keys = vlc_meta_CopyExtraNames(p_meta );
info_category_t *p_cat = NULL;
- if( psz_provider || *ppsz_all_keys[0] )
+ if( psz_provider || ( ppsz_all_keys[0] && *ppsz_all_keys[0] ) )
{
char *psz_cat = EsOutProgramGetMetaName( p_pgrm );
if( psz_cat )
es->fmt.i_id = out->p_sys->i_id;
if( !es->fmt.i_original_fourcc )
es->fmt.i_original_fourcc = es->fmt.i_codec;
- es->fmt.i_codec = vlc_fourcc_GetCodec( es->fmt.i_cat, es->fmt.i_codec );
+ if( es->fmt.i_cat == AUDIO_ES )
+ es->fmt.i_codec = vlc_fourcc_GetCodecAudio( es->fmt.i_codec,
+ es->fmt.audio.i_bitspersample );
+ else
+ es->fmt.i_codec = vlc_fourcc_GetCodec( es->fmt.i_cat,
+ es->fmt.i_codec );
es->i_id = es->fmt.i_id;
es->i_meta_id = out->p_sys->i_id;
}
else if( p_sys->i_mode == ES_OUT_MODE_PARTIAL )
{
- vlc_value_t val;
- int i;
- var_Get( p_sys->p_input, "programs", &val );
- for ( i = 0; i < val.p_list->i_count; i++ )
+ char *prgms = var_GetNonEmptyString( p_sys->p_input, "programs" );
+ if( prgms != NULL )
{
- if ( val.p_list->p_values[i].i_int == es->p_pgrm->i_id || b_force )
+ char *buf;
+
+ for ( const char *prgm = strtok_r( prgms, ",", &buf );
+ prgm != NULL;
+ prgm = strtok_r( NULL, ",", &buf ) )
{
- if( !EsIsSelected( es ) )
- EsSelect( out, es );
- break;
+ if( atoi( prgm ) == es->p_pgrm->i_id || b_force )
+ {
+ if( !EsIsSelected( es ) )
+ EsSelect( out, es );
+ break;
+ }
}
+ free( prgms );
}
- var_FreeList( &val, NULL );
}
else if( p_sys->i_mode == ES_OUT_MODE_AUTO )
{
if( i_pts_delay > __MIN( i_pts_delay_base + i_jitter_max, INPUT_PTS_DELAY_MAX ) )
{
msg_Err( p_sys->p_input,
- "ES_OUT_SET_(GROUP_)PCR is called too late (jitter of %d ms ingnored)",
+ "ES_OUT_SET_(GROUP_)PCR is called too late (jitter of %d ms ignored)",
(int)(i_pts_delay - i_pts_delay_base) / 1000 );
i_pts_delay = p_sys->i_pts_delay;
}
const char *psz_codec_description =
vlc_fourcc_GetDescription( p_fmt_es->i_cat, p_fmt_es->i_codec );
- const vlc_fourcc_t i_codec_fourcc = p_fmt_es->i_original_fourcc ?: p_fmt_es->i_codec;
+ const vlc_fourcc_t i_codec_fourcc = ( p_fmt_es->i_original_fourcc )?
+ p_fmt_es->i_original_fourcc : p_fmt_es->i_codec;
if( psz_codec_description )
info_category_AddInfo( p_cat, _("Codec"), "%s (%.4s)",
psz_codec_description, (char*)&i_codec_fourcc );