Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
0761641d
authored
Feb 24, 2023
by
Mayur K
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Use edts media time offset if edits list duration is entire media duration.
parent
0c17605f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
libraries/extractor/src/main/java/androidx/media3/extractor/mp4/FragmentedMp4Extractor.java
libraries/extractor/src/main/java/androidx/media3/extractor/mp4/FragmentedMp4Extractor.java
View file @
0761641d
...
@@ -970,6 +970,23 @@ public class FragmentedMp4Extractor implements Extractor {
...
@@ -970,6 +970,23 @@ public class FragmentedMp4Extractor implements Extractor {
return
version
==
1
?
tfdt
.
readUnsignedLongToLong
()
:
tfdt
.
readUnsignedInt
();
return
version
==
1
?
tfdt
.
readUnsignedLongToLong
()
:
tfdt
.
readUnsignedInt
();
}
}
private
static
boolean
isEdtsListDurationForEntireMediaTimeline
(
Track
track
)
{
// Currently we only support a single edit that moves the entire media timeline (indicated by
// duration == 0 or (editListDurationUs + editListMediaTimeUs) >= track duration.
// Other uses of edit lists are uncommon and unsupported.
if
(
track
.
editListDurations
!=
null
&&
track
.
editListDurations
.
length
==
1
&&
track
.
editListMediaTimes
!=
null
)
{
long
editListDurationUs
=
Util
.
scaleLargeTimestamp
(
track
.
editListDurations
[
0
],
C
.
MICROS_PER_SECOND
,
track
.
movieTimescale
);
long
editListMediaTimeUs
=
Util
.
scaleLargeTimestamp
(
track
.
editListMediaTimes
[
0
],
C
.
MICROS_PER_SECOND
,
track
.
timescale
);
return
editListDurationUs
==
0
||
((
editListDurationUs
+
editListMediaTimeUs
)
>=
track
.
durationUs
);
}
return
false
;
}
/**
/**
* Parses a trun atom (defined in 14496-12).
* Parses a trun atom (defined in 14496-12).
*
*
...
@@ -1017,11 +1034,8 @@ public class FragmentedMp4Extractor implements Extractor {
...
@@ -1017,11 +1034,8 @@ public class FragmentedMp4Extractor implements Extractor {
// ensure that the first frame's presentation timestamp is zero.
// ensure that the first frame's presentation timestamp is zero.
long
edtsOffset
=
0
;
long
edtsOffset
=
0
;
// Currently we only support a single edit that moves the entire media timeline (indicated by
// Currently we only support a single edit that moves the entire media timeline.
// duration == 0). Other uses of edit lists are uncommon and unsupported.
if
(
isEdtsListDurationForEntireMediaTimeline
(
track
))
{
if
(
track
.
editListDurations
!=
null
&&
track
.
editListDurations
.
length
==
1
&&
track
.
editListDurations
[
0
]
==
0
)
{
edtsOffset
=
castNonNull
(
track
.
editListMediaTimes
)[
0
];
edtsOffset
=
castNonNull
(
track
.
editListMediaTimes
)[
0
];
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment