File tree Expand file tree Collapse file tree 3 files changed +4
-3
lines changed
Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ def self.file_format_from_signature(io)
6262 # M4A is checked for first, since MP4 files start with a chunk size -
6363 # and that chunk size may incidentally match another signature.
6464 # No other formats would reasonably have "ftyp" as the next for bytes.
65- return "m4a" if [ "ftypM4A " . b , "ftyp3gp4" . b ] . include? ( signature [ 4 ...12 ] )
65+ return "m4a" if [ "ftypM4A " . b , "ftyp3gp4" . b , "ftypmp42" . b ] . include? ( signature [ 4 ...12 ] )
6666 # Handled separately simply because it requires two checks.
6767 return "wav" if signature . start_with? ( "RIFF" . b ) && signature [ 8 ...12 ] == "WAVE" . b
6868 magic_numbers = {
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ def parse
5252 def parse_id3_tag
5353 @file_io . rewind
5454 signature = @file_io . read ( 6 )
55+ @file_io . rewind
5556
5657 if signature . start_with? ( "ID3" . b )
5758 id3_v2_tag = ID3 ::V2 . new ( @file_io )
@@ -72,7 +73,7 @@ def parse_duration
7273 @bitrate = ( bytes_count * 8 / @duration / 1000 ) . round unless @duration . zero?
7374 else
7475 @bitrate = mpeg_frame_header . frame_bitrate
75- @duration = ( file_size - ( @id3_tag &.size || 0 ) ) * 8 / ( @bitrate * 1000 ) . to_f unless @bitrate . zero?
76+ @duration = ( file_size - ( @id3_tag &.size || 0 ) ) * 8 / ( @bitrate * 1000 ) . to_f unless @bitrate . to_i . zero?
7677 end
7778 end
7879
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
33module WahWah
4- VERSION = "1.6.5 "
4+ VERSION = "1.6.6 "
55end
You can’t perform that action at this time.
0 commit comments