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
a626a5e5
authored
Jun 26, 2015
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Take period start time into account when calculating segment times.
parent
2b27137e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
library/src/main/java/com/google/android/exoplayer/dash/DashChunkSource.java
library/src/main/java/com/google/android/exoplayer/dash/DashWrappingSegmentIndex.java
library/src/main/java/com/google/android/exoplayer/dash/mpd/Representation.java
library/src/main/java/com/google/android/exoplayer/dash/DashChunkSource.java
View file @
a626a5e5
...
...
@@ -531,7 +531,8 @@ public class DashChunkSource implements ChunkSource {
if
(
initializationChunk
.
hasSeekMap
())
{
representationHolder
.
segmentIndex
=
new
DashWrappingSegmentIndex
(
(
ChunkIndex
)
initializationChunk
.
getSeekMap
(),
initializationChunk
.
dataSpec
.
uri
.
toString
());
initializationChunk
.
dataSpec
.
uri
.
toString
(),
representationHolder
.
representation
.
periodStartMs
*
1000
);
}
// The null check avoids overwriting drmInitData obtained from the manifest with drmInitData
// obtained from the stream, as per DASH IF Interoperability Recommendations V3.0, 7.5.3.
...
...
@@ -638,7 +639,8 @@ public class DashChunkSource implements ChunkSource {
DataSpec
dataSpec
=
new
DataSpec
(
segmentUri
.
getUri
(),
segmentUri
.
start
,
segmentUri
.
length
,
representation
.
getCacheKey
());
long
sampleOffsetUs
=
-
1
*
representation
.
presentationTimeOffsetUs
;
long
sampleOffsetUs
=
representation
.
periodStartMs
*
1000
-
representation
.
presentationTimeOffsetUs
;
if
(
representation
.
format
.
mimeType
.
equals
(
MimeTypes
.
TEXT_VTT
))
{
if
(
representationHolder
.
vttHeaderOffsetUs
!=
sampleOffsetUs
)
{
// Update the VTT header.
...
...
library/src/main/java/com/google/android/exoplayer/dash/DashWrappingSegmentIndex.java
View file @
a626a5e5
...
...
@@ -26,14 +26,17 @@ public class DashWrappingSegmentIndex implements DashSegmentIndex {
private
final
ChunkIndex
chunkIndex
;
private
final
String
uri
;
private
final
long
startTimeUs
;
/**
* @param chunkIndex The {@link ChunkIndex} to wrap.
* @param uri The URI where the data is located.
* @param startTimeUs The start time of the index, in microseconds.
*/
public
DashWrappingSegmentIndex
(
ChunkIndex
chunkIndex
,
String
uri
)
{
public
DashWrappingSegmentIndex
(
ChunkIndex
chunkIndex
,
String
uri
,
long
startTimeUs
)
{
this
.
chunkIndex
=
chunkIndex
;
this
.
uri
=
uri
;
this
.
startTimeUs
=
startTimeUs
;
}
@Override
...
...
@@ -48,7 +51,7 @@ public class DashWrappingSegmentIndex implements DashSegmentIndex {
@Override
public
long
getTimeUs
(
int
segmentNum
)
{
return
chunkIndex
.
timesUs
[
segmentNum
];
return
chunkIndex
.
timesUs
[
segmentNum
]
+
startTimeUs
;
}
@Override
...
...
@@ -63,7 +66,7 @@ public class DashWrappingSegmentIndex implements DashSegmentIndex {
@Override
public
int
getSegmentNum
(
long
timeUs
)
{
return
chunkIndex
.
getChunkIndex
(
timeUs
);
return
chunkIndex
.
getChunkIndex
(
timeUs
-
startTimeUs
);
}
@Override
...
...
library/src/main/java/com/google/android/exoplayer/dash/mpd/Representation.java
View file @
a626a5e5
...
...
@@ -266,12 +266,12 @@ public abstract class Representation implements FormatWrapper {
@Override
public
int
getSegmentNum
(
long
timeUs
)
{
return
segmentBase
.
getSegmentNum
(
timeUs
);
return
segmentBase
.
getSegmentNum
(
timeUs
-
periodStartMs
*
1000
);
}
@Override
public
long
getTimeUs
(
int
segmentIndex
)
{
return
segmentBase
.
getSegmentTimeUs
(
segmentIndex
);
return
segmentBase
.
getSegmentTimeUs
(
segmentIndex
)
+
periodStartMs
*
1000
;
}
@Override
...
...
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