Commit daff83c6 authored by François Cartegnie's avatar François Cartegnie 🤞

demux: adaptive: rename prepareFormatChange

and add a no PCR reset condition
parent ec854b64
......@@ -105,7 +105,7 @@ AbstractStream::~AbstractStream()
vlc_mutex_destroy(&lock);
}
void AbstractStream::prepareFormatChange()
void AbstractStream::prepareRestart(bool b_discontinuity)
{
if(demuxer)
{
......@@ -113,7 +113,8 @@ void AbstractStream::prepareFormatChange()
demuxer->drain();
/* Enqueue Del Commands for all current ES */
fakeesout->scheduleAllForDeletion();
fakeesout->schedulePCRReset();
if(b_discontinuity)
fakeesout->schedulePCRReset();
commandsqueue->Commit();
/* ignoring demuxer's own Del commands */
commandsqueue->setDrop(true);
......@@ -281,7 +282,7 @@ AbstractStream::buffering_status AbstractStream::bufferize(mtime_t nz_deadline,
if(discontinuity)
{
msg_Dbg( p_realdemux, "Flushing on format change" );
prepareFormatChange();
prepareRestart();
discontinuity = false;
commandsqueue->setFlush();
vlc_mutex_unlock(&lock);
......@@ -318,7 +319,7 @@ AbstractStream::buffering_status AbstractStream::bufferize(mtime_t nz_deadline,
if(discontinuity)
{
msg_Dbg( p_realdemux, "Flushing on discontinuity" );
prepareFormatChange();
prepareRestart();
discontinuity = false;
commandsqueue->setFlush();
vlc_mutex_unlock(&lock);
......
......@@ -101,7 +101,7 @@ namespace adaptive
virtual bool startDemux();
virtual bool restartDemux();
virtual void prepareFormatChange();
virtual void prepareRestart(bool = true);
bool discontinuity;
......
......@@ -86,9 +86,9 @@ AbstractDemuxer * HLSStream::createDemux(const StreamFormat &format)
return ret;
}
void HLSStream::prepareFormatChange()
void HLSStream::prepareRestart(bool b_discontinuity)
{
AbstractStream::prepareFormatChange();
AbstractStream::prepareRestart(b_discontinuity);
if((unsigned)format == StreamFormat::PACKEDAAC)
{
fakeesout->setTimestampOffset( i_aac_offset );
......
......@@ -35,7 +35,7 @@ namespace hls
protected:
virtual AbstractDemuxer * createDemux(const StreamFormat &); /* reimpl */
virtual bool restartDemux(); /* reimpl */
virtual void prepareFormatChange(); /* reimpl */
virtual void prepareRestart(bool = true); /* reimpl */
virtual block_t *checkBlock(block_t *, bool); /* reimpl */
......
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