-
Notifications
You must be signed in to change notification settings - Fork 7
VPLAY-12359 suboptimal UTCTiming behavior #853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
a8e0d9f
e57c144
63776aa
2721698
8f74660
e14c9ec
4c48ceb
7d42196
517d732
12f9951
0746e42
4301e0e
b2d00e2
e4cdd35
80af1c4
0d6425a
b3faaf0
79ac33a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -368,7 +368,8 @@ static const ConfigLookupEntryBool mConfigLookupTableBool[AAMPCONFIG_BOOL_COUNT] | |
| {false, "curlThroughput", eAAMPConfig_CurlThroughput, false }, | ||
| {false, "useFireboltSDK", eAAMPConfig_UseFireboltSDK, false}, | ||
| {true, "enableChunkInjection", eAAMPConfig_EnableChunkInjection, true}, | ||
| {false, "debugChunkTransfer", eAAMPConfig_DebugChunkTransfer, false} | ||
| {false, "debugChunkTransfer", eAAMPConfig_DebugChunkTransfer, false}, | ||
| {true, "utcSyncOnStartup", eAAMPConfig_UTCSyncOnStartup, true} | ||
| }; | ||
|
|
||
| #define CONFIG_INT_ALIAS_COUNT 2 | ||
|
|
@@ -468,9 +469,12 @@ static const ConfigLookupEntryInt mConfigLookupTableInt[AAMPCONFIG_INT_COUNT+CON | |
| {DEFAULT_MONITOR_AV_JUMP_THRESHOLD_MS,"monitorAVJumpThreshold",eAAMPConfig_MonitorAVJumpThreshold,true,eCONFIG_RANGE_MONITOR_AVSYNC_JUMP_THRESHOLD }, | ||
| {DEFAULT_PROGRESS_LOGGING_DIVISOR,"progressLoggingDivisor",eAAMPConfig_ProgressLoggingDivisor,false}, | ||
| {DEFAULT_MONITOR_AV_REPORTING_INTERVAL, "monitorAVReportingInterval", eAAMPConfig_MonitorAVReportingInterval, false}, | ||
| {DEFAULT_UTC_SYNC_MIN_INTERVAL,"utcSyncMinIntervalSec",eAAMPConfig_UTCSyncMinIntervalSec,true }, | ||
| // add new entries here | ||
pstroffolino marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
pstroffolino marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| // aliases, kept for backwards compatibility | ||
| {DEFAULT_INIT_BITRATE,"defaultBitrate",eAAMPConfig_DefaultBitrate,true }, | ||
| {DEFAULT_INIT_BITRATE_4K,"defaultBitrate4K",eAAMPConfig_DefaultBitrate4K,true }, | ||
| {DEFAULT_INIT_BITRATE_4K,"defaultBitrate4K",eAAMPConfig_DefaultBitrate4K,true } | ||
| }; | ||
|
|
||
| /** | ||
|
|
@@ -495,7 +499,7 @@ static const ConfigLookupEntryFloat mConfigLookupTableFloat[AAMPCONFIG_FLOAT_COU | |
| {DEFAULT_NORMAL_RATE_CORRECTION_SPEED,"normalLatencyCorrectionPlaybackRate",eAAMPConfig_NormalLatencyCorrectionPlaybackRate,false}, | ||
| {DEFAULT_MIN_BUFFER_LOW_LATENCY,"lowLatencyMinBuffer",eAAMPConfig_LowLatencyMinBuffer,true, eCONFIG_RANGE_LLDBUFFER}, | ||
| {DEFAULT_TARGET_BUFFER_LOW_LATENCY,"lowLatencyTargetBuffer",eAAMPConfig_LowLatencyTargetBuffer,true, eCONFIG_RANGE_LLDBUFFER}, | ||
| {GST_BW_TO_BUFFER_FACTOR,"bandwidthToBufferFactor", eAAMPConfig_BWToGstBufferFactor,true}, | ||
| {GST_BW_TO_BUFFER_FACTOR,"bandwidthToBufferFactor", eAAMPConfig_BWToGstBufferFactor,true} | ||
|
||
| }; | ||
|
|
||
| /** | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4505,16 +4505,27 @@ bool StreamAbstractionAAMP_MPD::FindServerUTCTime(Node* root) | |
| aamp_ResolveURL(ServerUrl, aamp->GetManifestUrl(), valueCopy.c_str(), false); | ||
| } | ||
|
|
||
| mLocalUtcTime = GetNetworkTime(ServerUrl, &http_error, aamp->GetNetworkProxy()); | ||
| if(mLocalUtcTime > 0 ) | ||
| double elapsed = (double)(aamp_GetCurrentTimeMS() - mTimeSyncClient.lastSync) / 1000; | ||
| if ((!mTimeSyncClient.hasSynced && ISCONFIGSET(eAAMPConfig_UTCSyncOnStartup)) || (elapsed >= GETCONFIGVALUE(eAAMPConfig_UTCSyncMinIntervalSec))) | ||
pstroffolino marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| { | ||
| double currentTime = (double)aamp_GetCurrentTimeMS() / 1000; | ||
| mDeltaTime = mLocalUtcTime - currentTime; | ||
| hasServerUtcTime = true; | ||
| mLocalUtcTime = GetNetworkTime(ServerUrl, &http_error, aamp->GetNetworkProxy()); | ||
| if(mLocalUtcTime > 0) | ||
| { | ||
| mTimeSyncClient.lastSync = aamp_GetCurrentTimeMS(); | ||
| mDeltaTime = mLocalUtcTime - (double)mTimeSyncClient.lastSync / 1000; | ||
|
||
| mTimeSyncClient.lastOffset = mDeltaTime; | ||
| mTimeSyncClient.hasSynced = true; | ||
| hasServerUtcTime = true; | ||
| } | ||
| else | ||
| { | ||
| AAMPLOG_WARN("Failed to read timeServer [%s] RetCode[%d]",ServerUrl.c_str(),http_error); | ||
pstroffolino marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
| else | ||
| else if(mTimeSyncClient.hasSynced) | ||
pstroffolino marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| { | ||
| AAMPLOG_ERR("Failed to read timeServer [%s] RetCode[%d]",ServerUrl.c_str(),http_error); | ||
| mDeltaTime = mTimeSyncClient.lastOffset; | ||
| hasServerUtcTime = true; | ||
| } | ||
| break; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,6 +67,19 @@ struct ProfileInfo | |
| int representationIndex; | ||
| }; | ||
|
|
||
| /** | ||
| * @struct TimeSyncClient | ||
| * @brief UTC time sync client state | ||
| */ | ||
| struct TimeSyncClient | ||
|
||
| { | ||
| long long lastSync; // utcms time at which time was last synchronized with time server | ||
pstroffolino marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| double lastOffset; // current delta (seconds) between local and server time | ||
| bool hasSynced; // true if time has been synchronized at least once | ||
| TimeSyncClient(): lastSync(aamp_GetCurrentTimeMS()), lastOffset(0), hasSynced(false) | ||
| {} | ||
pstroffolino marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }; | ||
|
|
||
| class AampDashWorkerJob : public aamp::AampTrackWorkerJob | ||
| { | ||
| private: | ||
|
|
@@ -1244,6 +1257,7 @@ class StreamAbstractionAAMP_MPD : public StreamAbstractionAAMP | |
| bool mShortAdOffsetCalc; | ||
| AampTime mNextPts; /*For PTS restamping*/ | ||
| bool mIsFinalFirstPTS; /**< Flag to indicate if the first PTS is final or not */ | ||
pstroffolino marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| TimeSyncClient mTimeSyncClient; | ||
| }; | ||
|
|
||
| #endif //FRAGMENTCOLLECTOR_MPD_H_ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.