Commit 7ae1042d authored by François Cartegnie's avatar François Cartegnie 🤞

demux: adaptive: fix slow slavedemuxers

parent 648a5e5d
......@@ -155,12 +155,14 @@ bool SlaveDemuxer::create()
int SlaveDemuxer::demux(mtime_t nz_deadline)
{
if( demux_Control(p_demux, DEMUX_SET_NEXT_DEMUX_TIME, VLC_TS_0 + nz_deadline) != VLC_SUCCESS )
/* Always call with increment or buffering will get slow stuck */
mtime_t i_next_demux_time = VLC_TS_0 + nz_deadline + CLOCK_FREQ / 4;
if( demux_Control(p_demux, DEMUX_SET_NEXT_DEMUX_TIME, i_next_demux_time ) != VLC_SUCCESS )
{
b_eof = true;
return VLC_DEMUXER_EOF;
}
int ret = Demuxer::demux(nz_deadline);
es_out_Control(p_es_out, ES_OUT_SET_GROUP_PCR, 0, VLC_TS_0 + nz_deadline);
int ret = Demuxer::demux(i_next_demux_time);
es_out_Control(p_es_out, ES_OUT_SET_GROUP_PCR, 0, i_next_demux_time);
return ret;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment