fixup! Cleanup

This commit is contained in:
Rob Watson 2018-04-19 12:03:50 +02:00
parent 797a87ded8
commit 8c99f55145
2 changed files with 2 additions and 3 deletions

View File

@ -200,8 +200,7 @@ defmodule MPEGAudioFrameParser.Frame do
end end
end end
defp parse_padding(<<@sync_word::size(11), _::size(11), 0b0::size(1), _::bits>>), do: 0 defp parse_padding(<<@sync_word::size(11), _::size(11), padding_bit::size(1), _::bits>>), do: padding_bit
defp parse_padding(<<@sync_word::size(11), _::size(11), 0b1::size(1), _::bits>>), do: 1
defp samples_per_frame(%Frame{layer: :layer1}), do: 384 defp samples_per_frame(%Frame{layer: :layer1}), do: 384
defp samples_per_frame(%Frame{layer: :layer2}), do: 1152 defp samples_per_frame(%Frame{layer: :layer2}), do: 1152

View File

@ -67,7 +67,7 @@ defmodule MPEGAudioFrameParser.Impl do
end end
# Synced, current frame not complete and we have bytes available. Add bytes to frame: # Synced, current frame not complete and we have bytes available. Add bytes to frame:
defp process_bytes(%{current_frame: %Frame{complete: false}} = state, packet) do defp process_bytes(state, packet) do
{:ok, frame, rest} = Frame.add_bytes(state.current_frame, packet) {:ok, frame, rest} = Frame.add_bytes(state.current_frame, packet)
process_bytes(%{state | current_frame: frame}, rest) process_bytes(%{state | current_frame: frame}, rest)
end end