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
6b44c6e6
authored
Aug 13, 2015
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fix single sample loading + seeking in HLS.
Issue #587
parent
87457d50
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
library/src/main/java/com/google/android/exoplayer/MediaFormat.java
library/src/main/java/com/google/android/exoplayer/SingleSampleSource.java
library/src/main/java/com/google/android/exoplayer/hls/HlsSampleSource.java
library/src/main/java/com/google/android/exoplayer/MediaFormat.java
View file @
6b44c6e6
...
@@ -138,6 +138,12 @@ public final class MediaFormat {
...
@@ -138,6 +138,12 @@ public final class MediaFormat {
maxHeight
);
maxHeight
);
}
}
public
MediaFormat
copyWithDurationUs
(
long
durationUs
)
{
return
new
MediaFormat
(
mimeType
,
maxInputSize
,
durationUs
,
width
,
height
,
rotationDegrees
,
pixelWidthHeightRatio
,
channelCount
,
sampleRate
,
language
,
initializationData
,
maxWidth
,
maxHeight
);
}
/**
/**
* @return A {@link MediaFormat} representation of this format.
* @return A {@link MediaFormat} representation of this format.
*/
*/
...
...
library/src/main/java/com/google/android/exoplayer/SingleSampleSource.java
View file @
6b44c6e6
...
@@ -176,7 +176,7 @@ public final class SingleSampleSource implements SampleSource, SampleSourceReade
...
@@ -176,7 +176,7 @@ public final class SingleSampleSource implements SampleSource, SampleSourceReade
// Private methods.
// Private methods.
private
void
maybeStartLoading
()
{
private
void
maybeStartLoading
()
{
if
(
loadingFinished
||
state
!
=
STATE_END_OF_STREAM
||
loader
.
isLoading
())
{
if
(
loadingFinished
||
state
=
=
STATE_END_OF_STREAM
||
loader
.
isLoading
())
{
return
;
return
;
}
}
if
(
currentLoadableException
!=
null
)
{
if
(
currentLoadableException
!=
null
)
{
...
...
library/src/main/java/com/google/android/exoplayer/hls/HlsSampleSource.java
View file @
6b44c6e6
...
@@ -136,7 +136,8 @@ public final class HlsSampleSource implements SampleSource, SampleSourceReader,
...
@@ -136,7 +136,8 @@ public final class HlsSampleSource implements SampleSource, SampleSourceReader,
downstreamMediaFormats
=
new
MediaFormat
[
trackCount
];
downstreamMediaFormats
=
new
MediaFormat
[
trackCount
];
mediaFormats
=
new
MediaFormat
[
trackCount
];
mediaFormats
=
new
MediaFormat
[
trackCount
];
for
(
int
i
=
0
;
i
<
trackCount
;
i
++)
{
for
(
int
i
=
0
;
i
<
trackCount
;
i
++)
{
mediaFormats
[
i
]
=
extractor
.
getMediaFormat
(
i
);
mediaFormats
[
i
]
=
extractor
.
getMediaFormat
(
i
).
copyWithDurationUs
(
chunkSource
.
getDurationUs
());
}
}
prepared
=
true
;
prepared
=
true
;
return
true
;
return
true
;
...
...
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