-
Notifications
You must be signed in to change notification settings - Fork 19
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
Hotfix Moov parser #178
Hotfix Moov parser #178
Conversation
lib/parsers/moov_parser/decoder.rb
Outdated
@@ -36,7 +36,7 @@ def as_json(*a) | |||
# matches the type, drilling down if a list of atom names is given | |||
def find_first_atom_by_path(atoms, *atom_types) | |||
type_to_find = atom_types.shift | |||
requisite = atoms.find { |e| e.atom_type == type_to_find } | |||
requisite = atoms.find { |e| e.is_a?(Atom) && e.atom_type == type_to_find } |
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.
I still not understand why the commit 2c8adbf broke it, but this change fix the problem!
I think I found the real problem.. The method def find_video_trak_atom(atoms)
trak_atoms = find_atoms_by_path(atoms, ['moov', 'trak'])
return [] if trak_atoms.empty? # <---- here Then, the method def parse_dimensions(decoder, atom_tree)
video_trak_atom = decoder.find_video_trak_atom(atom_tree)
tkhd = begin
if video_trak_atom # <----- here an empty array is considered TRUE
decoder.find_first_atom_by_path([video_trak_atom], 'trak', 'tkhd')
else I think the fix should be in method def find_video_trak_atom(atoms)
trak_atoms = find_atoms_by_path(atoms, ['moov', 'trak'])
return nil if trak_atoms.empty? # <---- here With that modification, all the tests passed and I tested a file from production having this new issue and it also worked! wdyt? |
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.
I left a comment before about the problem that I found
Good catch @fabioperrella :) the empty array played us. |
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.
nice!
I don't think it's a good choice, it would have hidden this problem, don't you think? |
Closes #177
This is blocking the nu backend release, since there are errors on spaceship which deployed 0.25.1 first