-
Notifications
You must be signed in to change notification settings - Fork 4
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
Don't fail when unknown sample types are encountered #116
Conversation
…s 0 (as the specification defines. Ignore unsupported sample types. Add tests checking if unsupported sample types are ignored
lib/membrane_mp4/demuxer/isom.ex
Outdated
|> Enum.filter(fn {_track_id, table} -> | ||
table.sample_description == nil | ||
end) | ||
|> length() |
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 use https://hexdocs.pm/elixir/1.12/Enum.html#count/2
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.
done
lib/membrane_mp4/demuxer/isom.ex
Outdated
@@ -512,12 +519,14 @@ defmodule Membrane.MP4.Demuxer.ISOM do | |||
defp sample_description_to_kind(%Membrane.H265{}), do: :video | |||
defp sample_description_to_kind(%Membrane.AAC{}), do: :audio | |||
defp sample_description_to_kind(%Membrane.Opus{}), do: :audio | |||
defp sample_description_to_kind(_other), do: :unknown |
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.
Is the new case used anywhere?
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.
If not, let's remove it
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.
it's indeed not used, I will remove it
lib/membrane_mp4/demuxer/isom.ex
Outdated
|> Enum.reject(fn {_track_id, table} -> table.sample_description == nil end) | ||
|> Enum.into(%{}) |
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.
|> Enum.reject(fn {_track_id, table} -> table.sample_description == nil end) | |
|> Enum.into(%{}) | |
|> Map.reject(fn {_track_id, table} -> table.sample_description == nil 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.
And let's extract it to a separate function
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.
done
Co-authored-by: Mateusz Front <[email protected]>
This PR:
tcmd
samples)stsz
entry list is read only whensample_size
equals 0 (as defined in the specification)