Skip to content

Commit b9dc37c

Browse files
VPLAY-11362:Playback starts at the actual position the user requested
VPLAY-11362:Playback starts at the actual position the user requested Reason for change: Adjusted Detla to match PTO and StartTime Test Procedure: Refer jira ticket VPLAY-11362 Priority: P1 Signed-off-by: srikanthreddybijjam-comcast <[email protected]>
1 parent 95e5b2d commit b9dc37c

File tree

4 files changed

+614
-4
lines changed

4 files changed

+614
-4
lines changed

AampMPDParseHelper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ double AampMPDParseHelper::GetPeriodStartTime(int periodIndex,uint64_t mLastPlay
585585
durationTotal += aamp_GetPeriodDuration(idx, mLastPlaylistDownloadTimeMs);
586586
}
587587
periodStart = ((double)durationTotal / (double)1000);
588-
if(mIsLiveManifest && (periodStart > 0))
588+
if(mIsLiveManifest && (periodStart >= 0))
589589
{
590590
periodStart += mAvailabilityStartTime;
591591
}

fragmentcollector_mpd.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2068,6 +2068,9 @@ double StreamAbstractionAAMP_MPD::SkipFragments( MediaStreamContext *pMediaStrea
20682068
double offset = (double)(pto - startTime) / (double)segmentTemplates.GetTimescale();
20692069
AAMPLOG_INFO("Adding PTO offset:%lf to skipTime: %lf", offset, skipTime);
20702070
skipTime += offset;
2071+
2072+
// fragmentTime is reduced from period offset to land on the right epoch value. Later fragmentTime is added with fragmentDuration, so the PTO gap is addressed here.
2073+
pMediaStreamContext->fragmentTime -= offset;
20712074
}
20722075
}
20732076
do
@@ -2238,6 +2241,8 @@ double StreamAbstractionAAMP_MPD::SkipFragments( MediaStreamContext *pMediaStrea
22382241
AAMPLOG_INFO("[%s] firstPTS %f, nextPTS %f skipTime %f fragmentDuration %f ", pMediaStreamContext->name, firstPTS, nextPTS, skipTime, fragmentDuration);
22392242
if (updateFirstPTS)
22402243
{
2244+
//If we land at the mid of a segment, the position reminder is added to fragment time. This corrects the epoch value to its original segment start time
2245+
pMediaStreamContext->fragmentTime += mVideoPosRemainder;
22412246
/*Keep the lower PTS */
22422247
if ( ((mFirstPTS == 0) || (firstPTS < mFirstPTS)) && (pMediaStreamContext->type == eTRACK_VIDEO))
22432248
{

priv_aamp.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7561,7 +7561,6 @@ long long PrivateInstanceAAMP::GetPositionMilliseconds()
75617561
{
75627562
mGetPositionMillisecondsMutexSoft.unlock();
75637563
}
7564-
75657564
return positionMilliseconds;
75667565
}
75677566

0 commit comments

Comments
 (0)