Skip to content

Commit

Permalink
fix: increase target duration
Browse files Browse the repository at this point in the history
target duration should be max segment duration
  • Loading branch information
trueChazza committed Apr 29, 2024
1 parent 39c6d6b commit 65b4721
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/hls_playlist.ex
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ defmodule HlsPlaylist do
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-ALLOW-CACHE:NO
#EXT-X-TARGETDURATION:#{Kernel.trunc(Float.floor(largest_segment))}
#EXT-X-TARGETDURATION:#{Kernel.trunc(Float.ceil(largest_segment))}
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-PLAYLIST-TYPE:VOD
#{Enum.join(Enum.reverse(segments), "\n")}
Expand Down
2 changes: 1 addition & 1 deletion test/hls_playlist_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ defmodule HlsPlaylistTest do
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-ALLOW-CACHE:NO
#EXT-X-TARGETDURATION:4
#EXT-X-TARGETDURATION:5
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-PLAYLIST-TYPE:VOD
#EXTINF:4.166667,
Expand Down

0 comments on commit 65b4721

Please sign in to comment.