Skip to content

Commit f4e3ff1

Browse files
authored
Fix a bug occuring when audio track is linked after video tracks in muxed_av mode (#114)
* Fix a bug with using audio pad ref instead of buffered video pad ref * Add test checking different order of linking
1 parent 9f0237c commit f4e3ff1

39 files changed

+120
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ In future, the support for MPEG-DASH is planned as well
1313
Add the following line to your `deps` in `mix.exs`. Run `mix deps.get`.
1414

1515
```elixir
16-
{:membrane_http_adaptive_stream_plugin, "~> 0.18.7"}
16+
{:membrane_http_adaptive_stream_plugin, "~> 0.18.8"}
1717
```
1818

1919
## Usage Example

lib/membrane_http_adaptive_stream/sink_bin.ex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ defmodule Membrane.HTTPAdaptiveStream.SinkBin do
192192
bin_input(pad)
193193
|> child({:parser, ref}, get_parser(pad_options.encoding, state))
194194
|> child({:cmaf_muxer, ref}, cmaf_child_definiton(pad_options))
195-
|> via_in(pad, options: track_options(ctx))
195+
|> via_in(pad, options: track_options(ctx.pad_options))
196196
|> get_child(:sink)
197197

198198
state = increment_streams_counters(state)
@@ -214,7 +214,7 @@ defmodule Membrane.HTTPAdaptiveStream.SinkBin do
214214
bin_input(pad)
215215
|> child({:parser, ref}, parser)
216216
|> child({:cmaf_muxer, ref}, muxer)
217-
|> via_in(pad, options: track_options(ctx))
217+
|> via_in(pad, options: track_options(ctx.pad_options))
218218
|> get_child(:sink),
219219
get_child(:audio_tee)
220220
|> get_child({:cmaf_muxer, ref})
@@ -245,7 +245,7 @@ defmodule Membrane.HTTPAdaptiveStream.SinkBin do
245245
bin_input(pad_data.ref)
246246
|> child({:parser, cmaf_ref}, get_parser(pad_data.options.encoding, state))
247247
|> child({:cmaf_muxer, cmaf_ref}, muxer)
248-
|> via_in(pad, options: track_options(ctx))
248+
|> via_in(pad_data.ref, options: track_options(pad_data.options))
249249
|> get_child(:sink),
250250
get_child(:audio_tee)
251251
|> get_child({:cmaf_muxer, cmaf_ref})
@@ -338,8 +338,8 @@ defmodule Membrane.HTTPAdaptiveStream.SinkBin do
338338
{[notify_parent: {:track_playable, track_info}], state}
339339
end
340340

341-
defp track_options(context) do
342-
context.pad_options
341+
defp track_options(pad_options) do
342+
pad_options
343343
|> Map.take([:track_name, :segment_duration, :partial_segment_duration, :max_framerate])
344344
|> Keyword.new()
345345
end

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule Membrane.HTTPAdaptiveStream.MixProject do
22
use Mix.Project
33

4-
@version "0.18.7"
4+
@version "0.18.8"
55
@github_url "https://github.com/membraneframework/membrane_http_adaptive_stream_plugin"
66

77
def project do
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#EXTM3U
2+
#EXT-X-VERSION:7
3+
#EXT-X-INDEPENDENT-SEGMENTS
4+
#EXT-X-STREAM-INF:BANDWIDTH=1252874,AVERAGE-BANDWIDTH=917273,RESOLUTION=480x270,FRAME-RATE=25,CODECS="avc1.42e015,mp4a.40.2"
5+
video_480x270.m3u8
6+
#EXT-X-STREAM-INF:BANDWIDTH=763588,AVERAGE-BANDWIDTH=447929,RESOLUTION=540x360,FRAME-RATE=25,CODECS="avc1.640015,mp4a.40.2"
7+
video_540x360.m3u8
8+
#EXT-X-STREAM-INF:BANDWIDTH=1087782,AVERAGE-BANDWIDTH=597835,RESOLUTION=720x480,FRAME-RATE=25,CODECS="avc1.64001e,mp4a.40.2"
9+
video_720x480.m3u8

0 commit comments

Comments
 (0)