Skip to content
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

Merged
merged 40 commits into from
Jan 17, 2024
Merged

rewrite timestamps #55

merged 40 commits into from
Jan 17, 2024

Conversation

bartkrak
Copy link
Contributor

@bartkrak bartkrak marked this pull request as ready for review December 19, 2023 10:32
@bartkrak bartkrak marked this pull request as draft December 19, 2023 10:32
@bartkrak bartkrak requested review from FelonEkonom and removed request for FelonEkonom December 19, 2023 10:33
@bartkrak bartkrak marked this pull request as ready for review December 20, 2023 13:05
.vscode/settings.json Outdated Show resolved Hide resolved
lib/membrane_opus/encoder.ex Outdated Show resolved Hide resolved
lib/membrane_opus/encoder.ex Outdated Show resolved Hide resolved
lib/membrane_opus/parser.ex Outdated Show resolved Hide resolved
lib/membrane_opus/parser.ex Outdated Show resolved Hide resolved
test/membrane_opus/encoder_test.exs Outdated Show resolved Hide resolved
test/membrane_opus/encoder_test.exs Outdated Show resolved Hide resolved
test/membrane_opus/parser_test.exs Outdated Show resolved Hide resolved
lib/membrane_opus/parser.ex Outdated Show resolved Hide resolved
@FelonEkonom FelonEkonom self-requested a review January 3, 2024 16:39
lib/membrane_opus/encoder.ex Outdated Show resolved Hide resolved
lib/membrane_opus/encoder.ex Show resolved Hide resolved
lib/membrane_opus/encoder.ex Outdated Show resolved Hide resolved
lib/membrane_opus/parser.ex Outdated Show resolved Hide resolved
lib/membrane_opus/parser.ex Outdated Show resolved Hide resolved
lib/membrane_opus/parser.ex Outdated Show resolved Hide resolved
test/membrane_opus/encoder_test.exs Outdated Show resolved Hide resolved
lib/membrane_opus/parser.ex Outdated Show resolved Hide resolved
lib/membrane_opus/parser.ex Outdated Show resolved Hide resolved
processor,
[packet | packets],
channels,
updated_state =
Copy link
Member

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

metadata: %{duration: fixture.duration}
}
end)
defp buffer_from_fixture(fixtures, self_delimited? \\ false) do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
defp buffer_from_fixture(fixtures, self_delimited? \\ false) do
defp buffers_from_fixtures(fixtures, self_delimited? \\ false) do

lib/membrane_opus/parser.ex Outdated Show resolved Hide resolved
@@ -58,6 +58,7 @@ defmodule Membrane.Opus.Encoder do
options
|> Map.from_struct()
|> Map.merge(%{
pts_current: nil,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pts_current: nil,
current_pts: nil,

Comment on lines 167 to 177
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

Copy link
Member

@FelonEkonom FelonEkonom Jan 12, 2024

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,

  1. If all checks pass, function should return :ok instead of nil
  2. name of the function should end with !

bartkrak and others added 6 commits January 15, 2024 01:13
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>
Copy link
Member

@FelonEkonom FelonEkonom left a 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

Comment on lines 135 to 139
defp set_current_pts(%{queue: <<>>} = state, input_pts) do
%{state | current_pts: input_pts}
end

defp set_current_pts(state, _input_pts), do: state
Copy link
Member

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

@bartkrak bartkrak merged commit 128ac62 into master Jan 17, 2024
3 checks passed
@bartkrak bartkrak deleted the elem-rewrite-timestamps branch January 17, 2024 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants