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
  • abdsaber000/vlc
  • falbrechtskirchinger/vlc
  • b.sullender/vlc
  • hulxv/vlc
  • zyad-ayad/vlc
  • shocknovaa/vlc
  • gremlinflat/vlc
  • Pratham24D/vlc
  • hmaarrfk/vlc
412 results
Show changes
Commits on Source (15)
......@@ -86,12 +86,14 @@ enum es_out_query_e
/* Set scrambled state for one es */
ES_OUT_SET_ES_SCRAMBLED_STATE, /* arg1=int i_group arg2=es_out_id_t* */
/* Stop any buffering being done, and ask if es_out has no more data to
* play.
/* Stop any buffering being done, and drain
* It will not block and so MUST be used carefully. The only good reason
* is for interactive playback (like for DVD menu).
* XXX You SHALL call ES_OUT_RESET_PCR before any other es_out_Control/Send calls. */
ES_OUT_GET_EMPTY, /* arg1=bool* res=cannot fail */
* XXX You SHALL call ES_OUT_RESET_PCR before any other es_out_Control/Send calls in case of success. */
ES_OUT_DRAIN, /* res=can fail */
/* Ask if es_out has no more data to play */
ES_OUT_IS_EMPTY, /* arg1=bool* res=cannot fail */
/* Set global meta data (The vlc_meta_t is not modified nor released) */
ES_OUT_SET_META, /* arg1=const vlc_meta_t * */
......
......@@ -2769,8 +2769,7 @@ static void blurayStillImage( demux_t *p_demux, unsigned i_timeout )
streamFlush(p_sys);
/* stop buffering */
bool b_empty;
es_out_Control( p_demux->out, ES_OUT_GET_EMPTY, &b_empty );
es_out_Control( p_demux->out, ES_OUT_DRAIN );
}
/* avoid busy loops (read returns no data) */
......@@ -3030,8 +3029,12 @@ static int blurayDemux(demux_t *p_demux)
if(p_sys->b_draining)
{
bool b_empty = false;
if(es_out_Control(p_sys->p_out, ES_OUT_GET_EMPTY, &b_empty) != VLC_SUCCESS || b_empty)
int ret = es_out_Control(p_sys->p_out, ES_OUT_DRAIN);
bool b_empty = true;
if (ret == VLC_SUCCESS)
es_out_Control(p_sys->p_out, ES_OUT_IS_EMPTY, &b_empty);
if (b_empty)
{
es_out_Control(p_sys->p_out, ES_OUT_RESET_PCR);
p_sys->b_draining = false;
......
......@@ -126,6 +126,7 @@ typedef struct
/* */
bool b_reset_pcr;
bool b_readahead;
bool b_wait_empty;
struct
{
......@@ -879,6 +880,20 @@ static int Demux( demux_t *p_demux )
int32_t i_len;
dvdnav_status_t status;
if( p_sys->b_wait_empty )
{
bool b_empty;
es_out_Control( p_sys->p_tf_out, ES_OUT_IS_EMPTY, &b_empty );
if( !b_empty )
{
vlc_tick_sleep( VLC_TICK_FROM_MS(40) );
return VLC_DEMUXER_SUCCESS;
}
p_sys->b_wait_empty = false;
/* Don't call RESET_PCR directly as we night need to handle NAV events */
p_sys->b_reset_pcr = true;
}
if( p_sys->b_readahead )
status = dvdnav_get_next_cache_block( p_sys->dvdnav, &packet, &i_event,
&i_len );
......@@ -951,11 +966,7 @@ static int Demux( demux_t *p_demux )
vlc_mutex_unlock( &p_sys->still.lock );
if( b_still_init )
{
DemuxForceStill( p_demux );
p_sys->b_reset_pcr = true;
}
vlc_tick_sleep( VLC_TICK_FROM_MS(40) );
break;
}
......@@ -1154,7 +1165,9 @@ static int Demux( demux_t *p_demux )
if( unlikely(!p_dsi) )
break;
const dsi_gi_t *p_dsi_gi = &p_dsi->dsi_gi;
if( p_dsi_gi->vobu_3rdref_ea != 0 )
if( p_dsi_gi->vobu_ea != 0 )
p_sys->i_vobu_flush = p_dsi_gi->vobu_ea;
else if( p_dsi_gi->vobu_3rdref_ea != 0 )
p_sys->i_vobu_flush = p_dsi_gi->vobu_3rdref_ea;
else if( p_dsi_gi->vobu_2ndref_ea != 0 )
p_sys->i_vobu_flush = p_dsi_gi->vobu_2ndref_ea;
......@@ -1210,8 +1223,10 @@ static int Demux( demux_t *p_demux )
case DVDNAV_WAIT:
msg_Dbg( p_demux, "DVDNAV_WAIT" );
bool b_empty;
es_out_Control( p_sys->p_tf_out, ES_OUT_GET_EMPTY, &b_empty );
bool b_empty = true;
int ret = es_out_Control( p_sys->p_tf_out, ES_OUT_DRAIN );
if( ret == VLC_SUCCESS )
es_out_Control( p_sys->p_tf_out, ES_OUT_IS_EMPTY, &b_empty );
if( !b_empty )
{
vlc_tick_sleep( VLC_TICK_FROM_MS(40) );
......@@ -1563,15 +1578,9 @@ static void DemuxForceStill( demux_t *p_demux )
{
demux_sys_t *p_sys = p_demux->p_sys;
static const uint8_t buffer[] = {
0x00, 0x00, 0x01, 0xe0, 0x00, 0x07,
0x80, 0x00, 0x00,
0x00, 0x00, 0x01, 0xB7,
};
DemuxBlock( p_demux, buffer, sizeof(buffer) );
bool b_empty;
es_out_Control( p_sys->p_tf_out, ES_OUT_GET_EMPTY, &b_empty );
int ret = es_out_Control( p_sys->p_tf_out, ES_OUT_DRAIN );
if (ret == VLC_SUCCESS)
p_sys->b_wait_empty = true;
}
/*****************************************************************************
......
......@@ -342,11 +342,6 @@ void AbstractStream::setLivePause(bool b)
}
}
bool AbstractStream::decodersDrained()
{
return fakeEsOut()->decodersDrained();
}
vlc_tick_t AbstractStream::getDemuxedAmount(Times from) const
{
vlc_tick_t i_demuxed = fakeEsOut()->commandsQueue()->getDemuxedAmount(from).continuous;
......
......@@ -87,7 +87,6 @@ namespace adaptive
BufferingStatus getBufferAndStatus(const Times &, vlc_tick_t, vlc_tick_t, vlc_tick_t *);
vlc_tick_t getDemuxedAmount(Times) const;
Status dequeue(Times, Times *);
bool decodersDrained();
class StreamPosition
{
......
......@@ -462,13 +462,6 @@ bool FakeESOut::hasSelectedEs(const AbstractFakeESOutID *id) const
return false;
}
bool FakeESOut::decodersDrained()
{
bool b_empty = true;
es_out_Control( real_es_out, ES_OUT_GET_EMPTY, &b_empty );
return b_empty;
}
bool FakeESOut::restarting() const
{
bool b = !recycle_candidates.empty();
......
......@@ -91,7 +91,6 @@ namespace adaptive
size_t esCount() const;
bool hasSelectedEs() const;
bool hasSelectedEs(const AbstractFakeESOutID *) const;
bool decodersDrained();
bool restarting() const;
void setExtraInfoProvider( ExtraFMTInfoInterface * );
vlc_tick_t fixTimestamp(vlc_tick_t);
......
......@@ -709,8 +709,10 @@ static int DemuxHEIF( demux_t *p_demux )
/* Displaying a picture */
if( p_sys->i_end_display_time > 0 )
{
bool b_empty;
es_out_Control( p_demux->out, ES_OUT_GET_EMPTY, &b_empty );
bool b_empty = true;
int ret = es_out_Control( p_demux->out, ES_OUT_DRAIN );
if( ret == VLC_SUCCESS )
es_out_Control( p_demux->out, ES_OUT_IS_EMPTY, &b_empty );
if( !b_empty || vlc_tick_now() <= p_sys->i_end_display_time )
{
vlc_tick_sleep( VLC_TICK_FROM_MS(40) );
......
......@@ -272,8 +272,10 @@ struct demux_cc
{
/* Signal EOF to the sout when the es_out is empty (so when the
* DecoderThread fifo are empty) */
bool b_empty;
es_out_Control( p_demux->s->out, ES_OUT_GET_EMPTY, &b_empty );
bool b_empty = true;
int ret = es_out_Control( p_demux->s->out, ES_OUT_DRAIN );
if( ret == VLC_SUCCESS )
es_out_Control( p_demux->s->out, ES_OUT_IS_EMPTY, &b_empty );
if( b_empty )
p_renderer->pf_send_input_event( p_renderer->p_opaque,
CC_INPUT_EVENT_EOF,
......
......@@ -230,6 +230,7 @@ typedef struct
vlc_tick_t i_buffering_extra_initial;
vlc_tick_t i_buffering_extra_stream;
vlc_tick_t i_buffering_extra_system;
bool b_draining;
/* Record */
sout_stream_t *p_sout_record;
......@@ -262,6 +263,7 @@ static void EsOutChangePosition(es_out_sys_t *out, bool b_flush, es_out_id_t *p_
static void EsOutProgramChangePause(es_out_sys_t *out, bool b_paused, vlc_tick_t i_date);
static void EsOutProgramsChangeRate(es_out_sys_t *out);
static void EsOutDecodersStopBuffering(es_out_sys_t *out, bool b_forced);
static void EsOutDrainDecoder(es_out_sys_t *p_sys, es_out_id_t *es, bool wait);
static void EsOutGlobalMeta(es_out_sys_t *p_out, const vlc_meta_t *p_meta);
static void EsOutMeta(es_out_sys_t *p_out, const vlc_meta_t *p_meta, const vlc_meta_t *p_progmeta);
static int EsOutEsUpdateFmt(es_out_id_t *es, const es_format_t *fmt);
......@@ -695,17 +697,13 @@ static vlc_tick_t EsOutGetWakeup(es_out_sys_t *p_sys)
return input_clock_GetWakeup( p_sys->p_pgrm->p_input_clock );
}
static bool EsOutDecodersIsEmpty(es_out_sys_t *p_sys)
{
es_out_id_t *es;
if( p_sys->b_buffering && p_sys->p_pgrm )
{
EsOutDecodersStopBuffering(p_sys, true);
if( p_sys->b_buffering )
return true;
}
static bool EsOutIsEmpty(es_out_sys_t *p_sys)
{
if( p_sys->b_buffering )
return true;
es_out_id_t *es;
foreach_es_then_es_slaves(es)
{
if( es->p_dec && !vlc_input_decoder_IsEmpty( es->p_dec ) )
......@@ -716,6 +714,30 @@ static bool EsOutDecodersIsEmpty(es_out_sys_t *p_sys)
return true;
}
static int EsOutDrain(es_out_sys_t *p_sys)
{
if( p_sys->p_pgrm == NULL ) /* Nothing to drain, assume es_out is empty */
return VLC_SUCCESS;
if( p_sys->b_buffering )
{
EsOutDecodersStopBuffering(p_sys, true);
if( p_sys->b_buffering )
return VLC_EGENERIC;
}
if( !p_sys->b_draining )
{
es_out_id_t *id;
foreach_es_then_es_slaves(id)
if (id->p_dec != NULL)
EsOutDrainDecoder(p_sys, id, false);
p_sys->b_draining = true;
}
return VLC_SUCCESS;
}
static void EsOutUpdateDelayJitter(es_out_sys_t *p_sys)
{
/* Update the clock pts delay only if the extra tracks delay changed */
......@@ -944,6 +966,7 @@ static void EsOutChangePosition(es_out_sys_t *p_sys, bool b_flush,
p_sys->i_buffering_extra_initial = 0;
p_sys->i_buffering_extra_stream = 0;
p_sys->i_buffering_extra_system = 0;
p_sys->b_draining = false;
p_sys->i_preroll_end = -1;
p_sys->i_prev_stream_level = -1;
}
......@@ -2925,6 +2948,7 @@ static int EsOutSend(es_out_t *out, es_out_id_t *es, block_t *p_block )
}
vlc_mutex_lock( &p_sys->lock );
assert( !p_sys->b_draining );
/* Shift all slaves timestamps with the main source normal time. This will
* allow to synchronize 2 demuxers with different time bases. Remove the
......@@ -3606,10 +3630,13 @@ static int EsOutVaControlLocked(es_out_sys_t *p_sys, input_source_t *source,
return VLC_SUCCESS;
}
case ES_OUT_GET_EMPTY:
case ES_OUT_DRAIN:
return EsOutDrain(p_sys);
case ES_OUT_IS_EMPTY:
{
bool *pb = va_arg( args, bool* );
*pb = EsOutDecodersIsEmpty(p_sys);
*pb = EsOutIsEmpty( p_sys );
return VLC_SUCCESS;
}
......@@ -3962,10 +3989,7 @@ static int EsOutVaPrivControlLocked(es_out_sys_t *p_sys, input_source_t *source,
}
case ES_OUT_PRIV_SET_EOS:
{
es_out_id_t *id;
foreach_es_then_es_slaves(id)
if (id->p_dec != NULL)
EsOutDrainDecoder(p_sys, id, false);
EsOutDrain(p_sys);
return VLC_SUCCESS;
}
case ES_OUT_PRIV_SET_VBI_PAGE:
......@@ -4097,6 +4121,7 @@ input_EsOutNew(input_thread_t *p_input, input_source_t *main_source, float rate,
p_sys->rate = rate;
p_sys->b_buffering = true;
p_sys->b_draining = false;
p_sys->i_preroll_end = -1;
p_sys->i_prev_stream_level = -1;
......
......@@ -212,10 +212,10 @@ es_out_GetBuffering(struct vlc_input_es_out *out)
}
static inline bool
es_out_GetEmpty(struct vlc_input_es_out *out)
es_out_IsEmpty(struct vlc_input_es_out *out)
{
bool b;
int i_ret = es_out_Control(&out->out, ES_OUT_GET_EMPTY, &b);
int i_ret = es_out_Control(&out->out, ES_OUT_IS_EMPTY, &b);
assert( !i_ret );
return b;
......
......@@ -491,16 +491,16 @@ static inline int es_out_in_PrivControl(struct vlc_input_es_out *p_out,
}
static int
ControlLockedGetEmpty(struct es_out_timeshift *p_sys,
input_source_t *in,
bool *pb_empty )
ControlLockedIsEmpty(struct es_out_timeshift *p_sys, input_source_t *in,
bool *pb_empty)
{
if( p_sys->b_delayed && TsHasCmd( p_sys->p_ts ) )
*pb_empty = false;
else
{
int ret = es_out_in_Control( p_sys->p_out, in, ES_OUT_GET_EMPTY, pb_empty );
assert( ret == VLC_SUCCESS );
int ret = es_out_in_Control( p_sys->p_out, in, ES_OUT_IS_EMPTY,
pb_empty );
assert( !ret );
}
return VLC_SUCCESS;
......@@ -654,6 +654,7 @@ static int ControlLocked( es_out_t *p_out, input_source_t *in, int i_query,
case ES_OUT_SET_ES_STATE:
case ES_OUT_SET_ES_CAT_POLICY:
case ES_OUT_SET_ES_FMT:
case ES_OUT_DRAIN:
{
ts_cmd_control_t cmd;
if( CmdInitControl( &cmd, in, i_query, args, p_sys->b_delayed ) )
......@@ -711,10 +712,10 @@ static int ControlLocked( es_out_t *p_out, input_source_t *in, int i_query,
p_es->p_es, p_hl );
}
/* Special internal input control */
case ES_OUT_GET_EMPTY:
case ES_OUT_IS_EMPTY:
{
bool *pb_empty = va_arg( args, bool* );
return ControlLockedGetEmpty(p_sys, in, pb_empty);
return ControlLockedIsEmpty(p_sys, in, pb_empty);
}
case ES_OUT_POST_SUBNODE:
......@@ -1615,6 +1616,7 @@ static int CmdInitControl( ts_cmd_control_t *p_cmd, input_source_t *in,
p_cmd->u.es_bool.b_bool = (bool)va_arg( args, int );
break;
case ES_OUT_DRAIN:
case ES_OUT_RESET_PCR: /* no arg */
break;
......@@ -1746,6 +1748,7 @@ CmdExecuteControl(struct es_out_timeshift *p_sys,
return es_out_in_Control( p_sys->p_out, in, i_query, p_cmd->u.int_i64.i_int,
p_cmd->u.int_i64.i_i64 );
case ES_OUT_DRAIN:
case ES_OUT_RESET_PCR: /* no arg */
return es_out_in_Control( p_sys->p_out, in, i_query );
......
......@@ -667,7 +667,7 @@ static void MainLoop( input_thread_t *p_input, bool b_interactive )
b_paused_at_eof = false;
}
else if( !es_out_GetEmpty( input_priv(p_input)->p_es_out ) )
else if( !es_out_IsEmpty( input_priv(p_input)->p_es_out ) )
{
msg_Dbg( p_input, "waiting decoder fifos to empty" );
i_wakeup = vlc_tick_now() + INPUT_IDLE_SLEEP;
......
......@@ -185,8 +185,9 @@ static int EsOutControl(es_out_t *out, input_source_t* in, int query, va_list ar
case ES_OUT_SET_GROUP_EPG:
case ES_OUT_DEL_GROUP:
case ES_OUT_SET_ES_SCRAMBLED_STATE:
case ES_OUT_DRAIN:
break;
case ES_OUT_GET_EMPTY:
case ES_OUT_IS_EMPTY:
*va_arg(args, bool *) = true;
break;
case ES_OUT_SET_META:
......