-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow selecting synchronization strategy #5
Conversation
a4ae20a
to
be774a0
Compare
lib/membrane/timestamp_queue.ex
Outdated
{{:buffer, buffer}, nil} -> | ||
priority = | ||
case timestamp_queue.synchronization_strategy do | ||
:synchronize_on_arrival -> | ||
-timestamp_queue.current_queue_time | ||
|
||
:explicit_offsets -> | ||
offset = Map.get(timestamp_queue.registered_pads_offsets, pad_ref, 0) | ||
offset - (buffer.dts || buffer.pts) | ||
end | ||
|
||
push_pad_on_heap(timestamp_queue, pad_ref, priority) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we spoke, let's move that to push_buffer
lib/membrane/timestamp_queue.ex
Outdated
nil when timestamp_queue.synchronization_strategy == :synchronize_on_arrival -> | ||
(buffer.dts || buffer.pts) - timestamp_queue.current_queue_time | ||
|
||
nil when timestamp_queue.synchronization_strategy == :explicit_offsets -> | ||
Map.get(timestamp_queue.registered_pads_offsets, pad_ref, 0) | ||
|
||
valid_offset -> | ||
valid_offset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's handle the first buffer separately
3053c4e
to
6e10e05
Compare
@@ -38,7 +38,7 @@ defmodule Membrane.TimestampQueue.Mixfile do | |||
defp deps do | |||
[ | |||
{:membrane_core, "~> 1.0"}, | |||
{:heap, "~> 3.0"}, | |||
{:heap, "~> 2.0"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because 3.0
has weird licence
Relates to membraneframework/membrane_core#734