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
19121f7b
authored
Apr 12, 2021
by
marcbaechinger
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Merge pull request #8764 from uvjustin:dev-v2
PiperOrigin-RevId: 367994410
parent
a449d0ca
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
3 deletions
RELEASENOTES.md
library/hls/src/main/java/com/google/android/exoplayer2/source/hls/HlsMediaSource.java
library/hls/src/test/java/com/google/android/exoplayer2/source/hls/HlsMediaSourceTest.java
RELEASENOTES.md
View file @
19121f7b
...
@@ -42,6 +42,8 @@
...
@@ -42,6 +42,8 @@
codec input size
codec input size
(
[
#8705
](
https://github.com/google/ExoPlayer/issues/8705
)
).
(
[
#8705
](
https://github.com/google/ExoPlayer/issues/8705
)
).
*
HLS:
*
HLS:
*
Fix bug of ignoring
`EXT-X-START`
when setting the live target offset
(
[
#8764
](
https://github.com/google/ExoPlayer/pull/8764
)
).
*
Fix incorrect application of byte ranges to
`EXT-X-MAP`
tags
*
Fix incorrect application of byte ranges to
`EXT-X-MAP`
tags
(
[
#8783
](
https://github.com/google/ExoPlayer/issues/8783
)
).
(
[
#8783
](
https://github.com/google/ExoPlayer/issues/8783
)
).
*
Fix issue that could cause playback to become stuck if corresponding
*
Fix issue that could cause playback to become stuck if corresponding
...
@@ -105,8 +107,7 @@
...
@@ -105,8 +107,7 @@
*
Update instructions and publishing configuration for releasing to Google's
*
Update instructions and publishing configuration for releasing to Google's
Maven repository instead of bintray/JCenter.
Maven repository instead of bintray/JCenter.
*
FFmpeg extension: Fix playback failure when switching to TrueHD tracks
*
FFmpeg extension: Fix playback failure when switching to TrueHD tracks
during playback
during playback (
[
#8616
](
https://github.com/google/ExoPlayer/issues/8616
)
).
(
[
#8616
](
https://github.com/google/ExoPlayer/issues/8616
)
).
### 2.13.2 (2021-02-25)
### 2.13.2 (2021-02-25)
...
...
library/hls/src/main/java/com/google/android/exoplayer2/source/hls/HlsMediaSource.java
View file @
19121f7b
...
@@ -616,7 +616,9 @@ public final class HlsMediaSource extends BaseMediaSource
...
@@ -616,7 +616,9 @@ public final class HlsMediaSource extends BaseMediaSource
HlsMediaPlaylist
.
ServerControl
serverControl
=
playlist
.
serverControl
;
HlsMediaPlaylist
.
ServerControl
serverControl
=
playlist
.
serverControl
;
// Select part hold back only if the playlist has a part target duration.
// Select part hold back only if the playlist has a part target duration.
long
offsetToEndOfPlaylistUs
;
long
offsetToEndOfPlaylistUs
;
if
(
serverControl
.
partHoldBackUs
!=
C
.
TIME_UNSET
if
(
playlist
.
startOffsetUs
!=
C
.
TIME_UNSET
)
{
offsetToEndOfPlaylistUs
=
playlist
.
durationUs
-
playlist
.
startOffsetUs
;
}
else
if
(
serverControl
.
partHoldBackUs
!=
C
.
TIME_UNSET
&&
playlist
.
partTargetDurationUs
!=
C
.
TIME_UNSET
)
{
&&
playlist
.
partTargetDurationUs
!=
C
.
TIME_UNSET
)
{
offsetToEndOfPlaylistUs
=
serverControl
.
partHoldBackUs
;
offsetToEndOfPlaylistUs
=
serverControl
.
partHoldBackUs
;
}
else
if
(
serverControl
.
holdBackUs
!=
C
.
TIME_UNSET
)
{
}
else
if
(
serverControl
.
holdBackUs
!=
C
.
TIME_UNSET
)
{
...
...
library/hls/src/test/java/com/google/android/exoplayer2/source/hls/HlsMediaSourceTest.java
View file @
19121f7b
...
@@ -293,6 +293,44 @@ public class HlsMediaSourceTest {
...
@@ -293,6 +293,44 @@ public class HlsMediaSourceTest {
}
}
@Test
@Test
public
void
loadPlaylist_withPlaylistStartTime_targetLiveOffsetFromStartTime
()
throws
TimeoutException
,
ParserException
{
String
playlistUri
=
"fake://foo.bar/media0/playlist.m3u8"
;
// The playlist has a duration of 16 seconds, and part hold back, hold back and start time
// defined.
String
playlist
=
"#EXTM3U\n"
+
"#EXT-X-PROGRAM-DATE-TIME:2020-01-01T00:00:00.0+00:00\n"
+
"#EXT-X-TARGETDURATION:4\n"
+
"#EXT-X-VERSION:3\n"
+
"#EXT-X-START:TIME-OFFSET=-15"
+
"#EXT-X-MEDIA-SEQUENCE:0\n"
+
"#EXTINF:4.00000,\n"
+
"fileSequence0.ts\n"
+
"#EXTINF:4.00000,\n"
+
"fileSequence1.ts\n"
+
"#EXTINF:4.00000,\n"
+
"fileSequence2.ts\n"
+
"#EXTINF:4.00000,\n"
+
"fileSequence3.ts\n"
+
"#EXT-X-PART-INF:PART-TARGET=0.5\n"
+
"#EXT-X-SERVER-CONTROL:HOLD-BACK=12,PART-HOLD-BACK=3"
;
// The playlist finishes 1 second before the current time.
SystemClock
.
setCurrentTimeMillis
(
Util
.
parseXsDateTime
(
"2020-01-01T00:00:17.0+00:00"
));
HlsMediaSource
.
Factory
factory
=
createHlsMediaSourceFactory
(
playlistUri
,
playlist
);
MediaItem
mediaItem
=
MediaItem
.
fromUri
(
playlistUri
);
HlsMediaSource
mediaSource
=
factory
.
createMediaSource
(
mediaItem
);
Timeline
timeline
=
prepareAndWaitForTimeline
(
mediaSource
);
Timeline
.
Window
window
=
timeline
.
getWindow
(
0
,
new
Timeline
.
Window
());
// The target live offset is picked from start time and then expressed in relation to the live
// edge (+1 seconds).
assertThat
(
window
.
liveConfiguration
.
targetOffsetMs
).
isEqualTo
(
16000
);
assertThat
(
window
.
defaultPositionUs
).
isEqualTo
(
0
);
}
@Test
public
void
loadPlaylist_targetLiveOffsetInMediaItem_targetLiveOffsetPickedFromMediaItem
()
public
void
loadPlaylist_targetLiveOffsetInMediaItem_targetLiveOffsetPickedFromMediaItem
()
throws
TimeoutException
,
ParserException
{
throws
TimeoutException
,
ParserException
{
String
playlistUri
=
"fake://foo.bar/media0/playlist.m3u8"
;
String
playlistUri
=
"fake://foo.bar/media0/playlist.m3u8"
;
...
...
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