Current section

40 Versions

Jump to

Compare versions

4 files changed
+22 additions
-9 deletions
  @@ -11,7 +11,7 @@ Add `kim_hls` to your dependencies in `mix.exs`:
11 11 ```elixir
12 12 def deps do
13 13 [
14 - {:kim_hls, "~> 2.5"}
14 + {:kim_hls, "~> 3.0"}
15 15 ]
16 16 end
17 17 ```
  @@ -28,6 +28,7 @@ This release is a major architectural update focused on a fully functional packa
28 28 - `#EXT-X-MEDIA` validation tightened (required attributes, CLOSED-CAPTIONS URI rules).
29 29 - Master and media playlist tests now assert RFC tag ordering and required attributes.
30 30 - Media target duration remains fixed to configured value (no per-playlist drift).
31 + - Tracker has been removed
31 32
32 33 ## Architecture
  @@ -1,6 +1,6 @@
1 1 {<<"links">>,[{<<"GitHub">>,<<"https://github.com/kim-company/kim_hls">>}]}.
2 2 {<<"name">>,<<"kim_hls">>}.
3 - {<<"version">>,<<"3.0.0">>}.
3 + {<<"version">>,<<"3.0.1">>}.
4 4 {<<"description">>,
5 5 <<"HTTP Live Streaming (HLS) library. Modules, variables and functionality is bound to RFC 8216.">>}.
6 6 {<<"elixir">>,<<"~> 1.14">>}.
  @@ -1264,23 +1264,30 @@ defmodule HLS.Packager do
1264 1264 if warnings != [] do
1265 1265 {:warning, warnings}
1266 1266 else
1267 - case check_mandatory_alignment(mandatory_tracks, sync_point, state) do
1267 + case check_track_alignment(state.tracks, mandatory_tracks, sync_point, state) do
1268 1268 :ok -> :ready
1269 1269 {:error, error} -> {:error, error}
1270 1270 end
1271 1271 end
1272 1272 end
1273 1273
1274 - defp check_mandatory_alignment([], _sync_point, _state), do: :ok
1274 + defp check_track_alignment(tracks, mandatory_tracks, sync_point, state) do
1275 + mandatory_ids = MapSet.new(Enum.map(mandatory_tracks, &elem(&1, 0)))
1275 1276
1276 - defp check_mandatory_alignment(tracks, sync_point, state) do
1277 1277 {timestamps, missing} =
1278 1278 Enum.reduce(tracks, {[], []}, fn {id, track}, {acc, missing_acc} ->
1279 1279 segment = segment_at_sync_point(track, sync_point)
1280 1280
1281 - case segment_timestamp_ns(segment) do
1282 - nil -> {acc, [id | missing_acc]}
1283 - ts -> {[{id, ts} | acc], missing_acc}
1281 + cond do
1282 + is_nil(segment) ->
1283 + {acc, missing_acc}
1284 +
1285 + segment_timestamp_ns(segment) == nil ->
1286 + {acc, [id | missing_acc]}
1287 +
1288 + true ->
1289 + ts = segment_timestamp_ns(segment)
1290 + {[{id, ts} | acc], missing_acc}
1284 1291 end
1285 1292 end)
1286 1293
  @@ -1303,6 +1310,10 @@ defmodule HLS.Packager do
1303 1310 end
1304 1311 end)
1305 1312
1313 + missing_mandatory =
1314 + missing
1315 + |> Enum.filter(&MapSet.member?(mandatory_ids, &1))
1316 +
1306 1317 if mismatches == [] and missing == [] do
1307 1318 :ok
1308 1319 else
  @@ -1316,6 +1327,7 @@ defmodule HLS.Packager do
1316 1327 reference_timestamp_ns: reference_ts,
1317 1328 mismatched_tracks: mismatches,
1318 1329 missing_tracks: missing,
1330 + missing_mandatory_tracks: missing_mandatory,
1319 1331 tolerance_ns: state.timing_tolerance_ns
1320 1332 }
1321 1333 }}
  @@ -6,7 +6,7 @@ defmodule HLS.MixProject do
6 6 def project do
7 7 [
8 8 app: :kim_hls,
9 - version: "3.0.0",
9 + version: "3.0.1",
10 10 elixir: "~> 1.14",
11 11 start_permanent: Mix.env() == :prod,
12 12 elixirc_paths: elixirc_paths(Mix.env()),