Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions streamabstraction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -805,13 +805,14 @@ bool MediaTrack::CheckForDiscontinuity(CachedFragment* cachedFragment, bool& fra
bool stopInjection = false;
StreamAbstractionAAMP* context = GetContext();
double injectedDuration = GetTotalInjectedDuration();
static constexpr double EPS = 0.01; // floating point comparison tolerance.

if(cachedFragment->fragment.capacity() != 0)
{
if ((cachedFragment->discontinuity || ptsError) && (AAMP_NORMAL_PLAY_RATE == aamp->rate))
{
bool isDiscoIgnoredForOtherTrack = aamp->IsDiscontinuityIgnoredForOtherTrack((AampMediaType)!type);
AAMPLOG_TRACE("track %s - encountered aamp discontinuity @position - %f, isDiscoIgnoredForOtherTrack - %d ptsError %d", name, cachedFragment->position, isDiscoIgnoredForOtherTrack,ptsError );
AAMPLOG_INFO("track %s - encountered aamp discontinuity @position - %f, isDiscoIgnoredForOtherTrack - %d ptsError %d", name, cachedFragment->position, isDiscoIgnoredForOtherTrack,ptsError );
if (eTRACK_SUBTITLE != type)
{
cachedFragment->discontinuity = false;
Expand All @@ -826,7 +827,7 @@ bool MediaTrack::CheckForDiscontinuity(CachedFragment* cachedFragment, bool& fra
* This was seen with subtitles where switching to a period with subtitles enabled from one without could result in fragments being pushed
* to an appsrc that wasn't configured (very timing dependent). In this case we want to process the discontinuity and configure the pipeline.
*/
if (injectedDuration == 0 && !aamp->mpStreamAbstractionAAMP->GetESChangeStatus()&& aamp->PipelineValid((AampMediaType)type))
if (std::fabs(injectedDuration) < EPS && !aamp->mpStreamAbstractionAAMP->GetESChangeStatus()&& aamp->PipelineValid((AampMediaType)type))
{
stopInjection = false;

Expand Down
Loading