From 8c99f551457eb742aa664144fcf9387fe8361018 Mon Sep 17 00:00:00 2001 From: Rob Watson Date: Thu, 19 Apr 2018 12:03:50 +0200 Subject: [PATCH] fixup! Cleanup --- lib/mpeg_audio_frame_parser/frame.ex | 3 +-- lib/mpeg_audio_frame_parser/impl.ex | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/mpeg_audio_frame_parser/frame.ex b/lib/mpeg_audio_frame_parser/frame.ex index 06476a2..b4f2888 100644 --- a/lib/mpeg_audio_frame_parser/frame.ex +++ b/lib/mpeg_audio_frame_parser/frame.ex @@ -200,8 +200,7 @@ defmodule MPEGAudioFrameParser.Frame do 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), 0b1::size(1), _::bits>>), do: 1 + defp parse_padding(<<@sync_word::size(11), _::size(11), padding_bit::size(1), _::bits>>), do: padding_bit defp samples_per_frame(%Frame{layer: :layer1}), do: 384 defp samples_per_frame(%Frame{layer: :layer2}), do: 1152 diff --git a/lib/mpeg_audio_frame_parser/impl.ex b/lib/mpeg_audio_frame_parser/impl.ex index 7fcdd5a..132d370 100644 --- a/lib/mpeg_audio_frame_parser/impl.ex +++ b/lib/mpeg_audio_frame_parser/impl.ex @@ -67,7 +67,7 @@ defmodule MPEGAudioFrameParser.Impl do end # 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) process_bytes(%{state | current_frame: frame}, rest) end