Skip to content

Commit

Permalink
Fix seeking in live HLS streams
Browse files Browse the repository at this point in the history
Issue:#4187

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194829857
  • Loading branch information
AquilesCanta authored and ojw28 committed May 7, 2018
1 parent c8ec77e commit d412dc9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@
([#4016](https://github.com/google/ExoPlayer/issues/4016)).
* Add support for multiple #EXT-X-MAP tags in a media playlist
([#4164](https://github.com/google/ExoPlayer/issues/4182)).
* Fix seeking in live streams
([#4187](https://github.com/google/ExoPlayer/issues/4187)).
* Fix ClearKey decryption error if the key contains a forward slash
([#4075](https://github.com/google/ExoPlayer/issues/4075)).
* Fix crash when switching surface on Huawei P9 Lite
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,12 @@ public void getNextChunk(HlsMediaChunk previous, long playbackPositionUs, long l
// If the playlist is too old to contain the chunk, we need to refresh it.
chunkMediaSequence = mediaPlaylist.mediaSequence + mediaPlaylist.segments.size();
} else {
// The playlist start time is subtracted from the target position because the segment start
// times are relative to the start of the playlist, but the target position is not.
chunkMediaSequence =
Util.binarySearchFloor(
mediaPlaylist.segments,
targetPositionUs,
/* value= */ targetPositionUs - mediaPlaylist.startTimeUs,
/* inclusive= */ true,
/* stayInBounds= */ !playlistTracker.isLive() || previous == null)
+ mediaPlaylist.mediaSequence;
Expand Down

0 comments on commit d412dc9

Please sign in to comment.