Skip to content
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

Calculate dash AvailableEndTimeInManifestUs in accurate. #1858

Open
1 task
Saeedtrs opened this issue Nov 6, 2024 · 0 comments
Open
1 task

Calculate dash AvailableEndTimeInManifestUs in accurate. #1858

Saeedtrs opened this issue Nov 6, 2024 · 0 comments
Assignees

Comments

@Saeedtrs
Copy link

Saeedtrs commented Nov 6, 2024

Version

Media3 1.1.0 / ExoPlayer 2.19.0

More version details

No response

Devices that reproduce the issue

Pixel 5 Android 13
Samsung S22 Android 13
Xiaomi mi-box 4 Android 10
and many other devices

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps

In a DASH stream with the provided manifest, ExoPlayer incorrectly calculates getAvailableEndTimeInManifestUs in DashMediaSource. Specifically, when it reaches the calculation for periodStartTimeInManifestUs + index.getTimeUs(lastAvailableSegmentNum) + index.getDurationUs(lastAvailableSegmentNum, periodDurationUs), ExoPlayer calculates 68812608000000 for adaptationSetAvailableEndTimeInManifestUs in the video AdaptationSet, but 68812647999999 for the audio AdaptationSet. Due to ExoPlayer selecting the minimum of these values, it uses 68812647999999, resulting in a windowDurationUs of 86399999999 (and sometimes it changes to 86399979999) instead of 86400000000.
index.getTimeUs(lastAvailableSegmentNum) function return incorrect value and index.getDurationUs(lastAvailableSegmentNum, periodDurationUs) works fine.
This discrepancy appears when the segment number falls within the range 34359740-34999999.

Below is the manifest used:

<?xml version="1.0" encoding="utf-8"?>
<MPD
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="urn:mpeg:dash:schema:mpd:2011"
	xmlns:xlink="http://www.w3.org/1999/xlink"
	xmlns:cenc="urn:mpeg:cenc:2013"
	xmlns:mspr="urn:microsoft:playready" xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="dynamic" minimumUpdatePeriod="PT500S" suggestedPresentationDelay="PT2S" availabilityStartTime="2022-08-23T00:30:16Z" publishTime="2024-10-30T14:05:39Z" minBufferTime="PT4.0S" timeShiftBufferDepth="PT86400S">
	<BaseURL>https://**************/224/3221229586/</BaseURL>
	<ProgramInformation></ProgramInformation>
	<Period id="0" start="PT0.0S">
		<AdaptationSet id="0" contentType="video" segmentAlignment="true" bitstreamSwitching="true" maxFrameRate="50/1">
			<Representation id="0" mimeType="video/mp4" codecs="avc1.4d401e" bandwidth="800000" width="768" height="432" frameRate="25/1" templateParsed="true">
				<SegmentTemplate duration="25600" startNumber="1" initialization="---" timescale="12800"></SegmentTemplate>
			</Representation>
			<Representation id="1" mimeType="video/mp4" codecs="avc1.4d401f" bandwidth="1400000" width="960" height="540" frameRate="25/1" templateParsed="true">
				<SegmentTemplate duration="25600" startNumber="1" initialization="---" timescale="12800"></SegmentTemplate>
			</Representation>
			<Representation id="2" mimeType="video/mp4" codecs="avc1.4d401f" bandwidth="2000000" width="960" height="540" frameRate="25/1" templateParsed="true">
				<SegmentTemplate duration="25600" startNumber="1" initialization="---" timescale="12800"></SegmentTemplate>
			</Representation>
			<Representation id="3" mimeType="video/mp4" codecs="avc1.4d4020" bandwidth="3000000" width="1280" height="720" frameRate="50/1" templateParsed="true">
				<SegmentTemplate duration="25600" startNumber="1" initialization="---" timescale="12800"></SegmentTemplate>
			</Representation>
			<Representation id="4" mimeType="video/mp4" codecs="avc1.4d402a" bandwidth="6000000" width="1920" height="1080" frameRate="50/1" templateParsed="true">
				<SegmentTemplate duration="25600" startNumber="1" initialization="---" timescale="12800"></SegmentTemplate>
			</Representation>
			<Representation id="5" mimeType="video/mp4" codecs="avc1.4d401e" bandwidth="400000" width="704" height="396" frameRate="25/1" templateParsed="true">
				<SegmentTemplate duration="25600" startNumber="1" initialization="---" timescale="12800"></SegmentTemplate>
			</Representation>
		</AdaptationSet>
		<AdaptationSet id="1" contentType="audio" segmentAlignment="true" bitstreamSwitching="true" lang="tur">
			<Representation id="7" mimeType="audio/mp4" codecs="mp4a.40.5" bandwidth="128000" audioSamplingRate="48000" templateParsed="true">
				<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
				<SegmentTemplate duration="96000" startNumber="1" initialization="---" timescale="48000"></SegmentTemplate>
			</Representation>
		</AdaptationSet>
	</Period>
	<UTCTiming schemeIdUri="urn:mpeg:dash:utc:http-iso:2014" value="https://time.akamai.com/?iso"/>
</MPD>

Expected result

windowDurationUs accurate

Actual result

the calculation of windowDurationUs is in accurate

Media

Not applicable

Bug Report

  • You will email the zip file produced by adb bugreport to [email protected] after filing this issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants