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
c4235d0e
authored
Oct 12, 2015
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Ignore tfdt boxes for SmoothStreaming playbacks.
Issue #838
parent
79055066
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
library/src/main/java/com/google/android/exoplayer/extractor/mp4/FragmentedMp4Extractor.java
library/src/main/java/com/google/android/exoplayer/smoothstreaming/SmoothStreamingChunkSource.java
library/src/main/java/com/google/android/exoplayer/extractor/mp4/FragmentedMp4Extractor.java
View file @
c4235d0e
...
...
@@ -53,6 +53,11 @@ public final class FragmentedMp4Extractor implements Extractor {
*/
public
static
final
int
WORKAROUND_EVERY_VIDEO_FRAME_IS_SYNC_FRAME
=
1
;
/**
* Flag to ignore any tfdt boxes in the stream.
*/
public
static
final
int
WORKAROUND_IGNORE_TFDT_BOX
=
2
;
private
static
final
byte
[]
PIFF_SAMPLE_ENCRYPTION_BOX_EXTENDED_TYPE
=
new
byte
[]
{-
94
,
57
,
79
,
82
,
90
,
-
101
,
79
,
20
,
-
94
,
68
,
108
,
66
,
124
,
100
,
-
115
,
-
12
};
...
...
@@ -329,7 +334,12 @@ public final class FragmentedMp4Extractor implements Extractor {
private
static
void
parseTraf
(
Track
track
,
DefaultSampleValues
extendsDefaults
,
ContainerAtom
traf
,
TrackFragment
out
,
int
workaroundFlags
,
byte
[]
extendedTypeScratch
)
{
LeafAtom
tfdtAtom
=
traf
.
getLeafAtomOfType
(
Atom
.
TYPE_tfdt
);
long
decodeTime
=
tfdtAtom
==
null
?
0
:
parseTfdt
(
traf
.
getLeafAtomOfType
(
Atom
.
TYPE_tfdt
).
data
);
long
decodeTime
;
if
(
tfdtAtom
==
null
||
(
workaroundFlags
&
WORKAROUND_IGNORE_TFDT_BOX
)
!=
0
)
{
decodeTime
=
0
;
}
else
{
decodeTime
=
parseTfdt
(
traf
.
getLeafAtomOfType
(
Atom
.
TYPE_tfdt
).
data
);
}
LeafAtom
tfhd
=
traf
.
getLeafAtomOfType
(
Atom
.
TYPE_tfhd
);
DefaultSampleValues
fragmentHeader
=
parseTfhd
(
extendsDefaults
,
tfhd
.
data
);
...
...
@@ -475,8 +485,7 @@ public final class FragmentedMp4Extractor implements Extractor {
long
timescale
=
track
.
timescale
;
long
cumulativeTime
=
decodeTime
;
boolean
workaroundEveryVideoFrameIsSyncFrame
=
track
.
type
==
Track
.
TYPE_vide
&&
((
workaroundFlags
&
WORKAROUND_EVERY_VIDEO_FRAME_IS_SYNC_FRAME
)
==
WORKAROUND_EVERY_VIDEO_FRAME_IS_SYNC_FRAME
);
&&
(
workaroundFlags
&
WORKAROUND_EVERY_VIDEO_FRAME_IS_SYNC_FRAME
)
!=
0
;
for
(
int
i
=
0
;
i
<
sampleCount
;
i
++)
{
// Use trun values if present, otherwise tfhd, otherwise trex.
int
sampleDuration
=
sampleDurationsPresent
?
trun
.
readUnsignedIntToInt
()
...
...
library/src/main/java/com/google/android/exoplayer/smoothstreaming/SmoothStreamingChunkSource.java
View file @
c4235d0e
...
...
@@ -427,7 +427,8 @@ public class SmoothStreamingChunkSource implements ChunkSource,
// Build the extractor.
FragmentedMp4Extractor
mp4Extractor
=
new
FragmentedMp4Extractor
(
FragmentedMp4Extractor
.
WORKAROUND_EVERY_VIDEO_FRAME_IS_SYNC_FRAME
);
FragmentedMp4Extractor
.
WORKAROUND_EVERY_VIDEO_FRAME_IS_SYNC_FRAME
|
FragmentedMp4Extractor
.
WORKAROUND_IGNORE_TFDT_BOX
);
Track
mp4Track
=
new
Track
(
trackIndex
,
mp4TrackType
,
element
.
timescale
,
durationUs
,
mediaFormat
,
trackEncryptionBoxes
,
mp4TrackType
==
Track
.
TYPE_vide
?
4
:
-
1
);
mp4Extractor
.
setTrack
(
mp4Track
);
...
...
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