-
Notifications
You must be signed in to change notification settings - Fork 5
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
rewrite timestamps #55
Conversation
lib/membrane_opus/parser.ex
Outdated
processor, | ||
[packet | packets], | ||
channels, | ||
updated_state = |
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.
You can just name this variable state
test/membrane_opus/parser_test.exs
Outdated
metadata: %{duration: fixture.duration} | ||
} | ||
end) | ||
defp buffer_from_fixture(fixtures, self_delimited? \\ false) do |
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.
defp buffer_from_fixture(fixtures, self_delimited? \\ false) do | |
defp buffers_from_fixtures(fixtures, self_delimited? \\ false) do |
lib/membrane_opus/encoder.ex
Outdated
@@ -58,6 +58,7 @@ defmodule Membrane.Opus.Encoder do | |||
options | |||
|> Map.from_struct() | |||
|> Map.merge(%{ | |||
pts_current: nil, |
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.
pts_current: nil, | |
current_pts: nil, |
lib/membrane_opus/encoder.ex
Outdated
defp check_pts_integrity(true = _flag, %Buffer{pts: pts}, input_pts) do | ||
if pts != input_pts do | ||
raise """ | ||
PTS values are not continuous | ||
""" | ||
end | ||
end | ||
|
||
defp check_pts_integrity(false = _flag, %Buffer{pts: _pts}, _input_pts) do | ||
end | ||
|
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.
In the another comment I have written that is should be deleted, but FYI if you want to write function that do some checks and raises if any of them is not met and does nothing otherwise,
- If all checks pass, function should return
:ok
instead ofnil
- name of the function should end with
!
Co-authored-by: Feliks Pobiedziński <38541925+FelonEkonom@users.noreply.github.com>
Co-authored-by: Feliks Pobiedziński <38541925+FelonEkonom@users.noreply.github.com>
Co-authored-by: Feliks Pobiedziński <38541925+FelonEkonom@users.noreply.github.com>
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.
Remove .vscode/settings.json
lib/membrane_opus/encoder.ex
Outdated
defp set_current_pts(%{queue: <<>>} = state, input_pts) do | ||
%{state | current_pts: input_pts} | ||
end | ||
|
||
defp set_current_pts(state, _input_pts), do: state |
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 move this below the public functions, or at least below the place it's first used
a7c53de
to
1ac385b
Compare
solves membraneframework/membrane_core#687