Skip to content

Commit

Permalink
Remove shifting and filling (should be handled by the app)
Browse files Browse the repository at this point in the history
  • Loading branch information
philipgiuliani committed Oct 8, 2024
1 parent 17756f8 commit 62d617c
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions lib/membrane/hls/sink_bin.ex
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,8 @@ defmodule Membrane.HLS.SinkBin do
%{pad_options: %{encoding: :AAC} = pad_opts},
state
) do
{_max_pts, track_pts} = resume_info(state.opts.packager_pid, track_id)

spec =
bin_input(pad)
|> child({:shifter, track_id}, %Membrane.HLS.Shifter{duration: track_pts})
|> via_in(Pad.ref(:input, track_id))
|> child({:muxer, track_id}, %Membrane.MP4.Muxer.CMAF{
segment_min_duration: pad_opts.segment_duration
Expand All @@ -130,11 +127,8 @@ defmodule Membrane.HLS.SinkBin do
%{pad_options: %{encoding: :H264} = pad_opts},
state
) do
{_max_pts, track_pts} = resume_info(state.opts.packager_pid, track_id)

spec =
bin_input(pad)
|> child({:shifter, track_id}, %Membrane.HLS.Shifter{duration: track_pts})
|> child({:muxer, track_id}, %Membrane.MP4.Muxer.CMAF{
segment_min_duration: pad_opts.segment_duration
})
Expand All @@ -153,12 +147,8 @@ defmodule Membrane.HLS.SinkBin do
%{pad_options: %{encoding: :TEXT} = pad_opts},
state
) do
{_max_pts, track_pts} = resume_info(state.opts.packager_pid, track_id)

spec =
bin_input(pad)
|> child({:shifter, track_id}, %Membrane.HLS.Shifter{duration: track_pts})
|> child({:filler, track_id}, %Membrane.HLS.TextFiller{from: track_pts})
|> child({:cues, track_id}, %Membrane.WebVTT.CueBuilderFilter{
min_duration: Membrane.Time.milliseconds(1500)
})
Expand Down Expand Up @@ -239,30 +229,6 @@ defmodule Membrane.HLS.SinkBin do
|> MapSet.equal?(ended_sinks)
end

defp resume_info(packager_pid, track_id) do
Agent.get(
packager_pid,
fn packager ->
max_pts =
Packager.max_track_duration(packager)
|> Ratio.new()
|> Membrane.Time.seconds()

track_pts =
if Packager.has_track?(packager, track_id) do
Packager.track_duration(packager, track_id)
|> Ratio.new()
|> Membrane.Time.seconds()
else
0
end

{max_pts, track_pts}
end,
:infinity
)
end

defp live_schedule_next_sync(state) do
state =
state
Expand Down

0 comments on commit 62d617c

Please sign in to comment.