mirror of
https://github.com/fly-apps/live_beats.git
synced 2024-11-25 09:20:59 +00:00
MP3 decoding tweaks
This commit is contained in:
parent
1fc60aae2a
commit
458900b522
1 changed files with 6 additions and 8 deletions
|
@ -55,14 +55,14 @@ defmodule LiveBeats.MP3Stat do
|
||||||
>>) do
|
>>) do
|
||||||
tag_size = decode_synchsafe_integer(tag_size_synchsafe)
|
tag_size = decode_synchsafe_integer(tag_size_synchsafe)
|
||||||
|
|
||||||
{rest, _ext_header_size} =
|
{rest, ext_header_size} =
|
||||||
if extended_header == 1 do
|
if extended_header == 1 do
|
||||||
skip_extended_header(major_version, rest)
|
skip_extended_header(major_version, rest)
|
||||||
else
|
else
|
||||||
{rest, 0}
|
{rest, 0}
|
||||||
end
|
end
|
||||||
|
|
||||||
parse_frames(major_version, rest, tag_size - extended_header)
|
parse_frames(major_version, rest, tag_size - ext_header_size, [])
|
||||||
end
|
end
|
||||||
|
|
||||||
defp parse_tag(_), do: %{}
|
defp parse_tag(_), do: %{}
|
||||||
|
@ -100,7 +100,10 @@ defmodule LiveBeats.MP3Stat do
|
||||||
{rest, ext_header_size}
|
{rest, ext_header_size}
|
||||||
end
|
end
|
||||||
|
|
||||||
defp parse_frames(major_version, data, tag_length_remaining, frames \\ [])
|
defp parse_frames(_, data, tag_length_remaining, frames)
|
||||||
|
when tag_length_remaining <= 0 do
|
||||||
|
{Map.new(frames), data}
|
||||||
|
end
|
||||||
|
|
||||||
defp parse_frames(
|
defp parse_frames(
|
||||||
major_version,
|
major_version,
|
||||||
|
@ -150,11 +153,6 @@ defmodule LiveBeats.MP3Stat do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp parse_frames(_, data, tag_length_remaining, frames)
|
|
||||||
when tag_length_remaining <= 0 do
|
|
||||||
{Map.new(frames), data}
|
|
||||||
end
|
|
||||||
|
|
||||||
defp parse_frames(_, data, _, frames) do
|
defp parse_frames(_, data, _, frames) do
|
||||||
{Map.new(frames), data}
|
{Map.new(frames), data}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue