Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • videolan/vlc
  • chouquette/vlc
  • bakiewicz.marek122/vlc
  • devnexen/vlc
  • rohanrajpal/vlc
  • blurrrb/vlc
  • gsoc/gsoc2019/darkapex/vlc
  • b1ue/vlc
  • fkuehne/vlc
  • magsoft/vlc
  • chub/vlc
  • cramiro9/vlc
  • robUx4/vlc
  • rom1v/vlc
  • akshayaky/vlc
  • tmk907/vlc
  • akymaster/vlc
  • govind.sharma/vlc
  • psilokos/vlc
  • xjbeta/vlc
  • jahan/vlc
  • 1480c1/vlc
  • amanchande/vlc
  • aaqib/vlc
  • rist/vlc
  • apol/vlc
  • mindfreeze/vlc
  • alexandre-janniaux/vlc
  • sandsmark/vlc
  • jagannatharjun/vlc
  • gsoc/gsoc2020/matiaslgonzalez/vlc
  • gsoc/gsoc2020/jagannatharjun/vlc
  • mstorsjo/vlc
  • gsoc/gsoc2020/vedenta/vlc
  • gsoc/gsoc2020/arnav-ishaan/vlc
  • gsoc/gsoc2020/andreduong/vlc
  • fuzun/vlc
  • gsoc/gsoc2020/vatsin/vlc
  • gsoc/gsoc2020/sagid/vlc
  • yaron/vlc
  • Phoenix/vlc
  • Garf/vlc
  • ePiratWorkarounds/vlc
  • tguillem/vlc
  • jnqnfe/vlc
  • mdc/vlc
  • Vedaa/vlc
  • rasa/vlc
  • quink/vlc
  • yealo/vlc
  • aleksey_ak/vlc
  • ePirat/vlc
  • ilya.yanok/vlc
  • asenat/vlc
  • m/vlc
  • bunjee/vlc
  • BLumia/vlc
  • sagudev/vlc
  • hamedmonji30/vlc
  • nullgemm/vlc
  • DivyamAhuja/vlc
  • thesamesam/vlc
  • dag7/vlc
  • snehil101/vlc
  • haasn/vlc
  • jbk/vlc
  • ValZapod/vlc
  • mfkl/vlc
  • WangChuan/vlc
  • core1024/vlc
  • GhostVaibhav/vlc
  • dfuhrmann/vlc
  • davide.prade/vlc
  • tmatth/vlc
  • Courmisch/vlc
  • zouya/vlc
  • hpi/vlc
  • EwoutH/vlc
  • aleung27/vlc
  • hengwu0/vlc
  • saladin/vlc
  • ashuio/vlc
  • richselwood/vlc
  • verma16Ayush/vlc
  • chemicalflash/vlc
  • PoignardAzur/vlc
  • huangjieNT/vlc
  • Blake-Haydon/vlc
  • AnuthaDev/vlc
  • gsoc/gsoc2021/mpd/vlc
  • nicolas_lequec/vlc
  • sambassaly/vlc
  • thresh/vlc
  • bonniegong/vlc
  • myaashish/vlc
  • stavros.vagionitis/vlc
  • ileoo/vlc
  • louis-santucci/vlc
  • cchristiansen/vlc
  • sabyasachi07/vlc
  • AbduAmeen/vlc
  • ashishb0410/vlc
  • urbanhusky/vlc
  • davidepietrasanta/vlc
  • riksleutelstad/vlc
  • jeremyVignelles/vlc
  • komh/vlc
  • iamjithinjohn/vlc
  • JohannesKauffmann/vlc2
  • kunglao/vlc
  • natzberg/vlc
  • jill/vlc
  • cwendling/vlc
  • adufou/vlc
  • ErwanAirone/vlc
  • HasinduDilshan10/vlc
  • vagrantc/vlc
  • rafiv/macos-bigsur-icon
  • Aymeriic/vlc
  • saranshg20/vlc
  • metzlove24/vlc
  • linkfanel/vlc
  • Ds886/vlc
  • metehan-arslan/vlc
  • Skantes/vlc
  • kgsandundananjaya96/vlc
  • mitchcapper/vlc
  • advaitgupta/vlc
  • StefanBruens/vlc
  • ratajs/vlc
  • T.M.F.B.3761/vlc
  • m222059/vlc
  • casemerrick/vlc
  • joshuaword2alt/vlc
  • sjwaddy/vlc
  • dima/vlc
  • Ybalrid/vlc
  • umxprime/vlc
  • eschmidt/vlc
  • vannieuwenhuysenmichelle/vlc
  • badcf00d/vlc
  • wesinator/vlc
  • louis/vlc
  • xqq/vlc
  • EmperorYP7/vlc
  • NicoLiam/vlc
  • loveleen/vlc
  • rofferom/vlc
  • rbultje/vlc
  • TheUnamed/vlc
  • pratiksharma341/vlc
  • Saurab17/vlc
  • purist.coder/vlc
  • Shuicheng/vlc
  • mdrrubel292/vlc
  • silverbleu00/vlc
  • metif12/vlc
  • asher-m/vlc
  • jeffk/vlc
  • Brandonbr1/vlc
  • beautyyuyanli/vlc
  • rego21/vlc
  • muyangren907/vlc
  • collectionbylawrencejason/vlc
  • evelez/vlc
  • GSMgeeth/vlc
  • Oneric/vlc
  • TJ5/vlc
  • XuanTung95/vlc
  • darrenjenny21/vlc
  • Trenly/vlc
  • RockyTDR/vlc
  • mjakubowski/vlc
  • caprica/vlc
  • ForteFrankie/vlc
  • seannamiller19/vlc
  • junlon2006/vlc
  • kiwiren6666/vlc
  • iuseiphonexs/vlc
  • fenngtun/vlc
  • Rajdutt999/vlc
  • typx/vlc
  • leon.vitanos/vlc
  • robertogarci0938/vlc
  • gsoc/gsoc2022/luc65r/vlc-mpd
  • skeller/vlc
  • MCJack123/vlc
  • luc65r/vlc-mpd
  • popov895/vlc
  • claucambra/vlc
  • brad/vlc
  • matthewmurua88/vlc
  • Tomas8874/vlc
  • philenotfound/vlc
  • makita-do3/vlc
  • LZXCorp/vlc
  • mar0x/vlc
  • senojetkennedy0102/vlc
  • shaneb243/vlc
  • ahmadbader/vlc
  • rajduttcse26/vlc-audio-filters
  • Juniorzito8415/vlc
  • achernyakov/vlc
  • lucasjetgroup/vlc
  • pupdoggy666/vlc
  • gmde9363/vlc
  • alexnwayne/vlc
  • bahareebrahimi781/vlc
  • hamad633666/vlc
  • umghof3112/vlc
  • joe0199771874/vlc
  • Octocats66666666/vlc
  • jjm_223/vlc
  • btech10110.19/vlc
  • sunnykfc028/vlc-audio-filters
  • loic/vlc
  • nguyenminhducmx1/vlc
  • JanekKrueger/vlc
  • bstubbington2/vlc
  • rcombs/vlc
  • Ordissimo/vlc
  • king7532/vlc
  • noobsauce101/vlc
  • schong0525/vlc
  • myQwil/vlc
  • apisbg91/vlc
  • geeboy0101017/vlc
  • kim.faughey/vlc
  • nurupo/vlc
  • yyusea/vlc
  • 0711235879.khco/vlc
  • ialo/vlc
  • iloveyeye2/vlc
  • gdtdftdqtd/vlc
  • leandroconsiglio/vlc
  • AndyHTML2012/vlc
  • ncz/vlc
  • lucenticus/vlc
  • knr1931/vlc
  • kjoonlee/vlc
  • chandrakant100/vlc-qt
  • johge42/vlc
  • polter/vlc
  • hexchain/vlc
  • Tushwrld/vlc
  • mztea928/vlc
  • jbelloncastro/vlc
  • alvinhochun/vlc
  • ghostpiratecrow/vlc
  • ujjwaltwitx/vlc
  • alexsonarin06/vlc
  • adrianbon76/vlc
  • altsod/vlc
  • damien.lucas44/vlc
  • dmytrivtaisa/vlc
  • utk202/vlc
  • aaxhrj/vlc
  • thomas.hermes/vlc
  • structurenewworldorder/vlc
  • slomo/vlc
  • wantlamy/vlc
  • musc.o3cminc/vlc
  • thebarshablog/vlc
  • kerrick/vlc
  • kratos142518/vlc
  • leogps/vlc
  • vacantron/vlc
  • luna_koly/vlc
  • Ratio2/vlc
  • anuoshemohammad/vlc
  • apsun/vlc
  • aaa1115910/vlc
  • alimotmoyo/vlc
  • Ambossmann/vlc
  • Sam-LearnsToCode/vlc
  • Chilledheart/vlc
  • Labnann/vlc
  • ktcoooot1/vlc
  • mohit-marathe/vlc
  • johnddx/vlc
  • manstabuk/vlc
  • Omar-ahmed314/vlc
  • vineethkm/vlc
  • 9Enemi86/vlc
  • radoslav.m.panteleev/vlc
  • ashishami2002/vlc
  • Corbax/vlc
  • firnasahmed/vlc
  • pelayarmalam4/vlc
  • c0ff330k/vlc
  • shikhindahikar/vlc
  • l342723951/vlc
  • christianschwandner/vlc
  • douniwan5788/vlc
  • 7damian7/vlc
  • ferdnyc/vlc
  • f.ales1/vlc
  • pandagby/vlc
  • BaaBaa/vlc
  • jewe37/vlc
  • w00drow/vlc
  • russelltg/vlc
  • ironicallygod/vlc
  • soumyaDghosh/vlc
  • linzihao1999/vlc
  • deyayush6/vlc
  • mibi88/vlc
  • newabdallah10/vlc
  • jhorbincolombia/vlc
  • rimvihaqueshupto/vlc
  • andrewkhon98/vlc
  • fab78/vlc
  • lapaz17/vlc
  • amanna13/vlc
  • mdakram28/vlc
  • 07jw1980/vlc
  • sohamgupta/vlc
  • Eson-Jia1/vlc
  • Sumou/vlc
  • vikram-kangotra/vlc
  • chalice191/vlc
  • olivercalder/vlc
  • aaasg4001/vlc
  • zipdox/vlc
  • kwizart/vlc
  • Dragon-S/vlc
  • jdemeule/vlc
  • gabriel_lt/vlc
  • locutusofborg/vlc
  • sammirata/vlc-librist
  • another/vlc
  • Benjamin_Loison/vlc
  • ahmedmoselhi/vlc
  • petergaal/vlc
  • huynhsontung/vlc
  • dariusmihut/vlc
  • tvermaashutosh/vlc
  • buti/vlc
  • Niram7777/vlc
  • rohan-here/vlc
  • balaji-sivasakthi/vlc
  • rlindner81/vlc
  • Kakadus/vlc
  • djain/vlc
  • ABBurmeister/vlc
  • craighuggins/vlc
  • orbea/vlc
  • maxos/vlc
  • aakarshmj/vlc
  • kblaschke/vlc
  • ankitm/vlc
  • advait-0/vlc
  • mohak2003/vlc
  • yselkowitz/vlc
  • AZM999/vlc-azm
  • andrey.turkin/vlc
  • Disha-Baghel/vlc
  • nowrep/vlc
  • Apeng/vlc
  • Choucroute_melba/vlc
  • autra/vlc
  • eclipseo/vlc
  • fhuber/vlc
  • olafhering/vlc
  • sdasda7777/vlc
  • 1div0/vlc
  • skosnits/vlc-extended-playlist-support
  • dnicolson/vlc
  • Timshel/vlc
  • octopols/vlc
  • MangalK/vlc
  • nima64/vlc
  • misawai/vlc
  • Alexander-Wilms/vlc
  • Maxime2/vlc-fork-for-visualizer
  • ww/vlc
  • jeske/vlc
  • sgross-emlix/vlc
  • morenonatural/vlc
  • freakingLovesVLC/vlc
  • borisgolovnev/vlc
  • mpromonet/vlc
  • diogo.simao-marques/vlc
  • masstock/vlc
  • pratikpatel8982/vlc
  • hugok79/vlc
  • longervision/vlc
  • abhiudaysurya/vlc
  • rishabhgarg/vlc
  • tumic/vlc
  • cart/vlc
  • shubham442/vlc
  • Aditya692005/vlc
  • sammirata/vlc4
  • syrykh/vlc
  • Vvorcun/macos-new-icon
  • AyaanshC/vlc
  • nasso/vlc
  • Quark/vlc
  • sebastinas/vlc
  • rhstone/vlc
  • talregev/vlc
  • Managor/vlc
403 results
Show changes
Commits on Source (20)
......@@ -5,6 +5,7 @@
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Jean-Paul Saman <jpsaman #_at_# m2x dot nl>
* Alexandre Janniaux <ajanni@videolabs.io>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
......@@ -316,14 +317,11 @@ default_val:
static inline int EsOutGetClosedCaptionsChannel( const es_format_t *p_fmt )
{
int i_channel;
if( p_fmt->i_codec == VLC_CODEC_CEA608 && p_fmt->subs.cc.i_channel < 4 )
i_channel = p_fmt->subs.cc.i_channel;
else if( p_fmt->i_codec == VLC_CODEC_CEA708 && p_fmt->subs.cc.i_channel < 64 )
i_channel = p_fmt->subs.cc.i_channel;
else
i_channel = -1;
return i_channel;
if ((p_fmt->i_codec == VLC_CODEC_CEA608 && p_fmt->subs.cc.i_channel < 4)
|| (p_fmt->i_codec == VLC_CODEC_CEA708 && p_fmt->subs.cc.i_channel < 64))
return p_fmt->subs.cc.i_channel;
return -1;
}
#define foreach_es_then_es_slaves( pos ) \
......@@ -550,45 +548,37 @@ static char *EsGetTitle( es_out_id_t *es )
/* Take care of the ES description */
if( fmt->psz_description && *fmt->psz_description )
{
if( es->psz_language && *es->psz_language )
{
if( asprintf( &title, "%s - [%s]", fmt->psz_description,
es->psz_language ) == -1 )
title = NULL;
}
else
title = strdup( fmt->psz_description );
if (es->psz_language == NULL || *es->psz_language == '\0')
return strdup(fmt->psz_description);
if (asprintf(&title, "%s - [%s]", fmt->psz_description,
es->psz_language) != -1)
return title;
}
else
else if (es->psz_language && *es->psz_language)
{
if( es->psz_language && *es->psz_language )
{
if( asprintf( &title, "%s %zu - [%s]", _("Track"),
es->i_pos, es->psz_language ) == -1 )
title = NULL;
}
else
{
if( asprintf( &title, "%s %zu", _("Track"), es->i_pos ) == -1 )
title = NULL;
}
if (asprintf(&title, "%s %zu - [%s]", _("Track"),
es->i_pos, es->psz_language ) != -1 )
return title;
}
else if (asprintf(&title, "%s %zu", _("Track"), es->i_pos) != -1)
return title;
return title;
return NULL;
}
static void EsRelease(es_out_id_t *es)
{
if (vlc_atomic_rc_dec(&es->rc))
{
free(es->psz_title);
free(es->psz_language);
free(es->psz_language_code);
es_format_Clean(&es->fmt);
input_source_Release(es->id.source);
free(es->id.str_id);
free(es);
}
if (!vlc_atomic_rc_dec(&es->rc))
return;
free(es->psz_title);
free(es->psz_language);
free(es->psz_language_code);
es_format_Clean(&es->fmt);
input_source_Release(es->id.source);
free(es->id.str_id);
free(es);
}
static void EsHold(es_out_id_t *es)
......@@ -757,90 +747,89 @@ static int EsOutSetRecord( es_out_t *out, bool b_record, const char *dir_path )
assert( ( b_record && !p_sys->p_sout_record ) || ( !b_record && p_sys->p_sout_record ) );
if( b_record )
if (!b_record)
{
char *psz_path = NULL;
if( dir_path == NULL )
vlc_list_foreach (p_es, &p_sys->es, node) /* Only master es */
{
psz_path = var_CreateGetNonEmptyString( p_input, "input-record-path" );
if( psz_path == NULL )
{
if( var_CountChoices( p_input, "video-es" ) )
psz_path = config_GetUserDir( VLC_VIDEOS_DIR );
else if( var_CountChoices( p_input, "audio-es" ) )
psz_path = config_GetUserDir( VLC_MUSIC_DIR );
else
psz_path = config_GetUserDir( VLC_DOWNLOAD_DIR );
}
if (!p_es->p_dec_record)
continue;
vlc_input_decoder_Flush(p_es->p_dec_record);
vlc_input_decoder_Delete(p_es->p_dec_record);
p_es->p_dec_record = NULL;
}
sout_StreamChainDelete(p_sys->p_sout_record, NULL);
p_sys->p_sout_record = NULL;
return VLC_SUCCESS;
}
dir_path = psz_path;
char *psz_path = NULL;
if (dir_path == NULL)
{
psz_path = var_CreateGetNonEmptyString(p_input, "input-record-path");
if (psz_path == NULL)
{
if (var_CountChoices(p_input, "video-es"))
psz_path = config_GetUserDir(VLC_VIDEOS_DIR);
else if (var_CountChoices(p_input, "audio-es"))
psz_path = config_GetUserDir(VLC_MUSIC_DIR);
else
psz_path = config_GetUserDir(VLC_DOWNLOAD_DIR);
}
char *psz_sout = NULL; // TODO conf
dir_path = psz_path;
}
char *psz_sout = NULL; // TODO conf
if( !psz_sout && dir_path )
if (!psz_sout && dir_path)
{
char *psz_file = input_item_CreateFilename(input_GetItem(p_input),
dir_path,
INPUT_RECORD_PREFIX, NULL);
if (psz_file)
{
char *psz_file = input_item_CreateFilename( input_GetItem(p_input),
dir_path,
INPUT_RECORD_PREFIX, NULL );
if( psz_file )
char* psz_file_esc = config_StringEscape(psz_file);
if (psz_file_esc)
{
char* psz_file_esc = config_StringEscape( psz_file );
if ( psz_file_esc )
{
if( asprintf( &psz_sout, "#record{dst-prefix='%s'}", psz_file_esc ) < 0 )
psz_sout = NULL;
free( psz_file_esc );
}
free( psz_file );
if (asprintf(&psz_sout, "#record{dst-prefix='%s'}", psz_file_esc) < 0)
psz_sout = NULL;
free(psz_file_esc);
}
free(psz_file);
}
free( psz_path );
}
free(psz_path);
if( !psz_sout )
return VLC_EGENERIC;
if (!psz_sout)
return VLC_EGENERIC;
p_sys->p_sout_record = sout_NewInstance( p_input, psz_sout );
free( psz_sout );
p_sys->p_sout_record = sout_NewInstance(p_input, psz_sout);
free(psz_sout);
if( !p_sys->p_sout_record )
return VLC_EGENERIC;
vlc_list_foreach( p_es, &p_sys->es, node ) /* Only master es */
{
if( !p_es->p_dec )
continue;
if (!p_sys->p_sout_record)
return VLC_EGENERIC;
const struct vlc_input_decoder_cfg cfg = {
.fmt = &p_es->fmt,
.str_id = p_es->id.str_id,
.clock = NULL,
.resource = input_priv(p_input)->p_resource,
.sout = p_sys->p_sout_record,
.input_type = INPUT_TYPE_NONE,
.cbs = &decoder_cbs,
.cbs_data = p_es,
};
vlc_list_foreach (p_es, &p_sys->es, node) /* Only master es */
{
if (p_es->p_dec == NULL)
continue;
p_es->p_dec_record = vlc_input_decoder_New( VLC_OBJECT(p_input), &cfg );
const struct vlc_input_decoder_cfg cfg = {
.fmt = &p_es->fmt,
.str_id = p_es->id.str_id,
.clock = NULL,
.resource = input_priv(p_input)->p_resource,
.sout = p_sys->p_sout_record,
.input_type = INPUT_TYPE_NONE,
.cbs = &decoder_cbs,
.cbs_data = p_es,
};
if( p_es->p_dec_record && p_sys->b_buffering )
vlc_input_decoder_StartWait( p_es->p_dec_record );
}
}
else
{
vlc_list_foreach( p_es, &p_sys->es, node ) /* Only master es */
{
if( !p_es->p_dec_record )
continue;
p_es->p_dec_record = vlc_input_decoder_New(VLC_OBJECT(p_input), &cfg);
vlc_input_decoder_Flush(p_es->p_dec_record);
vlc_input_decoder_Delete( p_es->p_dec_record );
p_es->p_dec_record = NULL;
}
sout_StreamChainDelete( p_sys->p_sout_record, NULL );
p_sys->p_sout_record = NULL;
if (p_es->p_dec_record != NULL && p_sys->b_buffering)
vlc_input_decoder_StartWait(p_es->p_dec_record);
}
return VLC_SUCCESS;
......@@ -1186,15 +1175,15 @@ static vlc_tick_t EsOutGetBuffering( es_out_t *out )
if( !p_sys->p_pgrm )
return 0;
else
{
vlc_tick_t i_stream_start, i_system_duration;
if( input_clock_GetState( p_sys->p_pgrm->p_input_clock,
&i_stream_start, &i_system_start,
&i_stream_duration, &i_system_duration ) )
return 0;
}
vlc_tick_t i_stream_start, i_system_duration;
/* If the input_clock is not ready, we don't have a reference point
* which means that buffering has not started, continue waiting. */
if (input_clock_GetState(p_sys->p_pgrm->p_input_clock,
&i_stream_start, &i_system_start,
&i_stream_duration, &i_system_duration))
return 0;
vlc_tick_t i_delay;
......@@ -1204,8 +1193,6 @@ static vlc_tick_t EsOutGetBuffering( es_out_t *out )
}
else
{
vlc_tick_t i_system_duration;
if( p_sys->b_paused )
{
i_system_duration = p_sys->i_pause_date - i_system_start;
......@@ -1580,41 +1567,35 @@ static char *EsOutProgramGetMetaName( es_out_pgrm_t *p_pgrm )
char *psz = NULL;
if( p_pgrm->p_meta && vlc_meta_Get( p_pgrm->p_meta, vlc_meta_Title ) )
{
if( asprintf( &psz, _("%s [%s %d]"), vlc_meta_Get( p_pgrm->p_meta, vlc_meta_Title ),
_("Program"), p_pgrm->i_id ) == -1 )
return NULL;
if (asprintf(&psz, _("%s [%s %d]"), vlc_meta_Get(p_pgrm->p_meta, vlc_meta_Title),
_("Program"), p_pgrm->i_id) != -1)
return psz;
}
else
{
if( asprintf( &psz, "%s %d", _("Program"), p_pgrm->i_id ) == -1 )
return NULL;
}
return psz;
else if (asprintf(&psz, "%s %d", _("Program"), p_pgrm->i_id) != -1)
return psz;
return NULL;
}
static char *EsOutProgramGetProgramName( es_out_pgrm_t *p_pgrm )
{
char *psz = NULL;
if( p_pgrm->p_meta && vlc_meta_Get( p_pgrm->p_meta, vlc_meta_Title ) )
{
return strdup( vlc_meta_Get( p_pgrm->p_meta, vlc_meta_Title ) );
}
else
{
if( asprintf( &psz, "%s %d", _("Program"), p_pgrm->i_id ) == -1 )
return NULL;
}
return psz;
if (asprintf(&psz, "%s %d", _("Program"), p_pgrm->i_id) != -1 )
return psz;
return NULL;
}
static char *EsInfoCategoryName( es_out_id_t* es )
{
char *psz_category;
if( asprintf( &psz_category, _("Stream '%s'"), es->id.str_id ) == -1 )
return NULL;
if (asprintf(&psz_category, _("Stream '%s'"), es->id.str_id) != -1)
return psz_category;
return psz_category;
return NULL;
}
static void EsOutProgramMeta( es_out_t *out, input_source_t *source,
......@@ -2208,21 +2189,21 @@ static es_out_id_t *EsOutAdd( es_out_t *out, input_source_t *source, const es_fo
static bool EsIsSelected( es_out_id_t *es )
{
if( es->p_master )
{
bool b_decode = false;
if( es->p_master->p_dec )
{
int i_channel = EsOutGetClosedCaptionsChannel( &es->fmt );
vlc_input_decoder_GetCcState( es->p_master->p_dec, es->fmt.i_codec,
i_channel, &b_decode );
}
return b_decode;
}
else
{
/* Some tracks, especially closed-captions, are extracted from an
* existing elementary stream through the packetizer or the decoder,
* which must be selected for the extracted track to be selected.
* In every other cases, we don't need to consider that. */
if (es->p_master == NULL)
return es->p_dec != NULL;
bool b_decode = false;
if( es->p_master->p_dec )
{
int i_channel = EsOutGetClosedCaptionsChannel( &es->fmt );
vlc_input_decoder_GetCcState( es->p_master->p_dec, es->fmt.i_codec,
i_channel, &b_decode );
}
return b_decode;
}
static void ClockUpdate(vlc_tick_t system_ts, vlc_tick_t ts, double rate,
......@@ -2544,15 +2525,10 @@ static void EsOutUnselectEs( es_out_t *out, es_out_id_t *es, bool b_update )
static bool EsOutSelectMatchPrioritized( const es_out_es_props_t *p_esprops,
const es_out_id_t *es )
{
/* Otherwise, fallback by priority */
if( p_esprops->p_main_es != NULL )
{
return ( es->fmt.i_priority > p_esprops->p_main_es->fmt.i_priority );
}
else
{
return ( es->fmt.i_priority > ES_PRIORITY_NOT_DEFAULTABLE );
}
return es->fmt.i_priority > p_esprops->p_main_es->fmt.i_priority;
return es->fmt.i_priority > ES_PRIORITY_NOT_DEFAULTABLE;
}
static bool EsOutSelectHasExplicitParams( const es_out_es_props_t *p_esprops )
......@@ -2818,16 +2794,17 @@ static void EsOutSelectList( es_out_t *out, enum es_format_category_e cat,
/* Now, select all ES from es_id_list */
foreach_es_then_es_slaves(other)
{
if( other->fmt.i_cat != cat )
if (other->fmt.i_cat != cat ||
!EsOutIdMatchEsList(other, es_id_list) ||
EsIsSelected(other))
{
continue;
}
if( EsOutIdMatchEsList( other, es_id_list ) && !EsIsSelected( other ) )
{
EsOutSelectEs( out, other, true );
EsOutSelectEs(out, other, true);
if( p_esprops->e_policy == ES_OUT_ES_POLICY_EXCLUSIVE )
break;
}
if (p_esprops->e_policy == ES_OUT_ES_POLICY_EXCLUSIVE)
break;
}
}
......@@ -3145,15 +3122,15 @@ static vlc_tick_t EsOutGetTracksDelay(es_out_t *out)
es_out_id_t *es;
foreach_es_then_es_slaves(es)
{
if (es->p_dec)
{
if (es->delay != VLC_TICK_MAX)
tracks_delay = __MIN(tracks_delay, es->delay);
else if (es->fmt.i_cat == AUDIO_ES)
has_audio = true;
else if (es->fmt.i_cat == SPU_ES)
has_spu = true;
}
if (es->p_dec == NULL)
continue;
if (es->delay != VLC_TICK_MAX)
tracks_delay = __MIN(tracks_delay, es->delay);
else if (es->fmt.i_cat == AUDIO_ES)
has_audio = true;
else if (es->fmt.i_cat == SPU_ES)
has_spu = true;
}
if (has_audio)
tracks_delay = __MIN(tracks_delay, p_sys->i_audio_delay);
......@@ -3185,17 +3162,17 @@ static int EsOutVaControlLocked( es_out_t *out, input_source_t *source,
case ES_OUT_SET_ES_STATE:
{
es_out_id_t *es = va_arg( args, es_out_id_t * );
bool b = va_arg( args, int );
if( b && !EsIsSelected( es ) )
bool request_select = va_arg(args, int);
bool is_selected = EsIsSelected(es);
if(request_select && !is_selected)
{
EsOutSelectEs( out, es, true );
return EsIsSelected( es ) ? VLC_SUCCESS : VLC_EGENERIC;
}
else if( !b && EsIsSelected( es ) )
{
if(!request_select && is_selected)
EsOutUnselectEs( out, es, es->p_pgrm == p_sys->p_pgrm );
return VLC_SUCCESS;
}
return VLC_SUCCESS;
}
......@@ -3243,21 +3220,18 @@ static int EsOutVaControlLocked( es_out_t *out, input_source_t *source,
foreach_es_then_es_slaves(other)
{
if( i_cat == IGNORE_ES )
if (i_cat == IGNORE_ES && es == other)
{
if (es == other)
if (i_query == ES_OUT_RESTART_ES && es->p_dec != NULL)
{
if (i_query == ES_OUT_RESTART_ES && es->p_dec != NULL)
{
EsOutDestroyDecoder(out, es);
EsOutCreateDecoder(out, es);
}
else if( i_query == ES_OUT_SET_ES )
{
EsOutSelect(out, es, true);
}
break;
EsOutDestroyDecoder(out, es);
EsOutCreateDecoder(out, es);
}
else if (i_query == ES_OUT_SET_ES)
{
EsOutSelect(out, es, true);
}
break;
}
else if (i_cat == UNKNOWN_ES || other->fmt.i_cat == i_cat)
{
......@@ -3287,16 +3261,16 @@ static int EsOutVaControlLocked( es_out_t *out, input_source_t *source,
return VLC_EGENERIC;
foreach_es_then_es_slaves(other)
{
if (es == other)
if (es != other)
continue;
if (EsIsSelected(other))
{
if (EsIsSelected(other))
{
EsOutUnselectEs(out, other, other->p_pgrm == p_sys->p_pgrm);
EsOutStopFreeVout( out );
return VLC_SUCCESS;
}
break;
EsOutUnselectEs(out, other, other->p_pgrm == p_sys->p_pgrm);
EsOutStopFreeVout(out);
return VLC_SUCCESS;
}
break;
}
return VLC_EGENERIC;
}
......@@ -3401,68 +3375,75 @@ static int EsOutVaControlLocked( es_out_t *out, input_source_t *source,
{
/* Check buffering state on master clock update */
EsOutDecodersStopBuffering( out, false );
return VLC_SUCCESS;
}
else if( p_pgrm == p_sys->p_pgrm )
{
if( p_sys->p_next_frame_es != NULL )
return VLC_SUCCESS;
/* Last pcr/clock update was late. We need to compensate by offsetting
from the clock the rendering dates */
if( i_late > 0 && ( !priv->p_sout ||
!priv->b_out_pace_control ) )
{
/* input_clock_GetJitter returns compound delay:
* - initial pts delay (buffering/caching)
* - jitter compensation
* - track offset pts delay
* updated on input_clock_Update
* Late/jitter amount is updated from median of late values */
vlc_tick_t i_clock_total_delay = input_clock_GetJitter( p_pgrm->p_input_clock );
/* Current jitter */
vlc_tick_t i_new_jitter = i_clock_total_delay
- p_sys->i_tracks_pts_delay
- p_sys->i_pts_delay;
/* If the clock update is late, we have 2 possibilities:
* - offset rendering a bit more by increasing the total pts-delay
* - ignore, set clock to a new reference ahead of previous one
* and flush buffers (because all previous pts will now be late) */
/* Avoid dangerously high value */
/* If the jitter increase is over our max or the total hits the maximum */
if( i_new_jitter > priv->i_jitter_max ||
i_clock_total_delay > INPUT_PTS_DELAY_MAX ||
/* jitter is always 0 due to median calculation first output
and low delay can't allow non reversible jitter increase
in branch below */
(b_low_delay && i_late > priv->i_jitter_max) )
{
msg_Err( p_sys->p_input,
"ES_OUT_SET_(GROUP_)PCR is called %d ms late (jitter of %d ms ignored)",
(int)MS_FROM_VLC_TICK(i_late),
(int)MS_FROM_VLC_TICK(i_new_jitter) );
if (p_pgrm != p_sys->p_pgrm || p_sys->p_next_frame_es != NULL)
return VLC_SUCCESS;
/* don't change the current jitter */
i_new_jitter = p_sys->i_pts_jitter;
}
else
{
msg_Err( p_sys->p_input,
"ES_OUT_SET_(GROUP_)PCR is called %d ms late (pts_delay increased to %d ms)",
(int)MS_FROM_VLC_TICK(i_late),
(int)MS_FROM_VLC_TICK(i_clock_total_delay) );
}
/* The PCR is not considered late, there is no compensation needed. */
if (i_late <= 0)
return VLC_SUCCESS;
/* The output is paced by another client, there is no clock
* compensation possible. */
if (priv->p_sout != NULL && priv->b_out_pace_control)
return VLC_SUCCESS;
/* Force a rebufferization when we are too late */
EsOutControlLocked( out, source, ES_OUT_RESET_PCR );
/* Last pcr/clock update was late. We need to compensate by offsetting
* from the clock the rendering dates. */
/* input_clock_GetJitter returns compound delay:
* - initial pts delay (buffering/caching)
* - jitter compensation
* - track offset pts delay
* updated on input_clock_Update
* Late/jitter amount is updated from median of late values */
vlc_tick_t i_clock_total_delay = input_clock_GetJitter(p_pgrm->p_input_clock);
/* Current jitter */
vlc_tick_t i_new_jitter = i_clock_total_delay
- p_sys->i_tracks_pts_delay
- p_sys->i_pts_delay;
/* If the clock update is late, we have 2 possibilities:
* - offset rendering a bit more by increasing the total pts-delay
* - ignore, set clock to a new reference ahead of previous one
* and flush buffers (because all previous pts will now be late) */
/* Avoid dangerously high value */
/* If the jitter increase is over our max or the total hits the maximum */
if (i_new_jitter > priv->i_jitter_max ||
i_clock_total_delay > INPUT_PTS_DELAY_MAX ||
/* jitter is always 0 due to median calculation first output
and low delay can't allow non reversible jitter increase
in branch below */
(b_low_delay && i_late > priv->i_jitter_max))
{
EsOutPrivControlLocked( out, source, ES_OUT_PRIV_SET_JITTER,
p_sys->i_pts_delay, i_new_jitter,
p_sys->i_cr_average );
}
msg_Err(p_sys->p_input,
"ES_OUT_SET_(GROUP_)PCR is called %d ms late (jitter of %d ms ignored)",
(int)MS_FROM_VLC_TICK(i_late),
(int)MS_FROM_VLC_TICK(i_new_jitter));
/* don't change the current jitter */
i_new_jitter = p_sys->i_pts_jitter;
}
else
{
msg_Err(p_sys->p_input,
"ES_OUT_SET_(GROUP_)PCR is called %d ms late (pts_delay increased to %d ms)",
(int)MS_FROM_VLC_TICK(i_late),
(int)MS_FROM_VLC_TICK(i_clock_total_delay));
}
/* Force a rebufferization when we are too late */
EsOutControlLocked(out, source, ES_OUT_RESET_PCR);
EsOutPrivControlLocked(out, source, ES_OUT_PRIV_SET_JITTER,
p_sys->i_pts_delay, i_new_jitter,
p_sys->i_cr_average);
return VLC_SUCCESS;
}
......@@ -3900,37 +3881,38 @@ static int EsOutVaPrivControlLocked( es_out_t *out, input_source_t *source,
if( source != p_sys->main_source )
return VLC_SUCCESS;
if( !p_sys->b_buffering )
if (p_sys->b_buffering)
{
vlc_tick_t i_delay;
input_SendEventTimes(p_sys->p_input, 0.0, VLC_TICK_INVALID,
i_normal_time, i_length);
return VLC_SUCCESS;
}
/* Fix for buffering delay */
if( !input_priv(p_sys->p_input)->p_sout ||
!input_priv(p_sys->p_input)->b_out_pace_control )
i_delay = EsOutGetBuffering( out );
else
i_delay = 0;
vlc_tick_t i_delay;
if( i_time != VLC_TICK_INVALID )
{
i_time -= i_delay;
if( i_time < VLC_TICK_0 )
i_time = VLC_TICK_0;
}
/* Fix for buffering delay */
if (!input_priv(p_sys->p_input)->p_sout ||
!input_priv(p_sys->p_input)->b_out_pace_control)
i_delay = EsOutGetBuffering(out);
else
i_delay = 0;
if( i_length != 0 )
f_position -= (double)i_delay / i_length;
if( f_position < 0 )
f_position = 0;
if (i_time != VLC_TICK_INVALID)
{
i_time -= i_delay;
if (i_time < VLC_TICK_0)
i_time = VLC_TICK_0;
}
assert( i_normal_time >= VLC_TICK_0 );
if (i_length != 0)
f_position -= (double)i_delay / i_length;
if (f_position < 0)
f_position = 0;
input_SendEventTimes( p_sys->p_input, f_position, i_time,
i_normal_time, i_length );
}
else
input_SendEventTimes( p_sys->p_input, 0.0, VLC_TICK_INVALID,
i_normal_time, i_length );
assert(i_normal_time >= VLC_TICK_0);
input_SendEventTimes(p_sys->p_input, f_position, i_time,
i_normal_time, i_length);
return VLC_SUCCESS;
}
case ES_OUT_PRIV_SET_JITTER:
......@@ -3953,16 +3935,15 @@ static int EsOutVaPrivControlLocked( es_out_t *out, input_source_t *source,
p_sys->i_cr_average = i_cr_average;
p_sys->i_tracks_pts_delay = i_tracks_pts_delay;
if (b_change_clock)
{
i_pts_delay += i_pts_jitter + i_tracks_pts_delay;
if (!b_change_clock)
return VLC_SUCCESS;
vlc_list_foreach(pgrm, &p_sys->programs, node)
{
input_clock_SetJitter(pgrm->p_input_clock, i_pts_delay,
i_cr_average);
vlc_clock_main_SetInputDejitter(pgrm->p_main_clock, i_pts_delay);
}
i_pts_delay += i_pts_jitter + i_tracks_pts_delay;
vlc_list_foreach(pgrm, &p_sys->programs, node)
{
input_clock_SetJitter(pgrm->p_input_clock,
i_pts_delay, i_cr_average);
vlc_clock_main_SetInputDejitter(pgrm->p_main_clock, i_pts_delay);
}
return VLC_SUCCESS;
}
......@@ -4644,16 +4625,15 @@ static void EsOutDeleteInfoEs( es_out_t *out, es_out_id_t *es )
es_out_sys_t *p_sys = container_of(out, es_out_sys_t, out);
input_thread_t *p_input = p_sys->p_input;
input_item_t *p_item = input_priv(p_input)->p_item;
char* psz_info_category;
char* psz_info_category = EsInfoCategoryName(es);
if (unlikely(psz_info_category == NULL))
return;
if( likely( psz_info_category = EsInfoCategoryName( es ) ) )
{
int ret = input_item_DelInfo( p_item, psz_info_category, NULL );
free( psz_info_category );
int ret = input_item_DelInfo(p_item, psz_info_category, NULL);
free(psz_info_category);
if( ret == VLC_SUCCESS && p_sys->input_type != INPUT_TYPE_PREPARSING )
input_SendEventMetaInfo( p_input );
}
if (ret == VLC_SUCCESS && p_sys->input_type != INPUT_TYPE_PREPARSING)
input_SendEventMetaInfo(p_input);
}
es_out_id_t *vlc_es_id_get_out(vlc_es_id_t *id)
......