mp3file 1.1.4 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ef86469a77e1c7d0557d66f5a1b03315aa4cb0aa
4
- data.tar.gz: 416bd6e21a1888607c6582924b099439082a5ea1
3
+ metadata.gz: cea56455b0c3fcd4691734fd996aa92b2e70c5bc
4
+ data.tar.gz: 577dad17813c5d17ff6f23db687ea98857f60e45
5
5
  SHA512:
6
- metadata.gz: 0d4ffe9eca9cd71ad5119532c5e72aa13b3c09e6b29543e82c098898553e26d9b25daa7eefc6d6a25992d5c04fe9adb2ef6060189bbe03e10ee36d27c76919f2
7
- data.tar.gz: b829fc5d498773401fdf771377ae4e4f8f8b3be9a2891d38627c34d3014e0e0ea479f655fad10b8c7c7cd2a2a9b3c5e1440ceb3494a95e4f6a5175944e5dfd13
6
+ metadata.gz: d06cbe98cbb7c9b86c13e3e0dc2ec2de5dabec8907145f9bf6860d35dcdaca0517e57a8d56d5596bf32f18c98fc535ca6e0b9c47e45de79173c80581efcd38fb
7
+ data.tar.gz: fcb827f6846adbac1a2f98186906875e30a8a44023baa01e0bb50018493a9a52e03bcd89490212cf3302cb4b2cdbaae0be2e0dac605ed740302f7601561f5315
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.6
4
+ - 2.1.9
5
+ - 2.1.10
6
+ - 2.2.5
7
+ - 2.3.1
@@ -200,15 +200,23 @@ module Mp3file
200
200
  end
201
201
  @num_frames = frame_headers.size
202
202
  else
203
- # Use the Xing header to make the VBR / CBR call. Assume that
204
- # Xing headers, when present in a CBR file, are called "Info".
205
- @vbr = @xing_header.nil? || @xing_header.name == "Xing"
203
+ # Use the presence and name of the Xing header to make the VBR
204
+ # / CBR call. Assume that Xing headers, when present in a CBR
205
+ # file, are called "Info".
206
+ @vbr = !@xing_header.nil? && @xing_header.name == "Xing"
206
207
  end
207
208
 
209
+ # puts "@num_frames = #{@num_frames.inspect}"
210
+ # puts "@xing_header = #{@xing_header.inspect}"
211
+ # puts "@audio_size = #{@audio_size.inspect}"
212
+ # puts "@first_header size = #{@first_header.frame_size.inspect}"
213
+
208
214
  # Find the number of frames. Prefer the actual frame count we
209
215
  # did (if we scanned all the frames) over the Xing
210
216
  # header. Prefer the Xing header over file size math.
211
- @num_frames = @num_frames || (@xing_header && @xing_header.frames) || (@audio_size / @first_header.frame_size)
217
+ @num_frames = @num_frames ||
218
+ (@xing_header && (@xing_header.frames + 1)) ||
219
+ (@audio_size / @first_header.frame_size)
212
220
 
213
221
  # Figure out the total samples and the time duration.
214
222
  @total_samples = @num_frames * @first_header.samples
@@ -221,6 +229,9 @@ module Mp3file
221
229
  @bitrate = ((@xing_header && @xing_header.bytes) || @audio_size) / @length.to_f * 8 / 1000
222
230
  end
223
231
 
232
+ # puts "@vbr = #{@vbr.inspect}"
233
+ # puts "@bitrate = #{@bitrate.inspect}"
234
+
224
235
  @file.close
225
236
  end
226
237
 
@@ -1,3 +1,3 @@
1
1
  module Mp3file
2
- VERSION = "1.1.4"
2
+ VERSION = "1.1.5"
3
3
  end
@@ -10,7 +10,8 @@ describe Mp3file::ID3v2::FrameHeader do
10
10
  describe("A 15-byte long TT2 frame header.") do
11
11
  subject { Mp3file::ID3v2::FrameHeader.new(StringIO.new("TT2\x00\x00\x0f"), tag) }
12
12
  its(:frame_id) { should == 'TT2' }
13
- its(:size) { should == 15 }
13
+ its(:size) { should == 21 }
14
+ its(:frame_size) { should == 15 }
14
15
  its(:preserve_on_altered_tag) { should == false }
15
16
  its(:preserve_on_altered_file) { should == false }
16
17
  its(:read_only) { should == false }
@@ -37,7 +38,8 @@ describe Mp3file::ID3v2::FrameHeader do
37
38
  describe("A 9-byte TIT2 frame header.") do
38
39
  subject { Mp3file::ID3v2::FrameHeader.new(StringIO.new("TIT2\x00\x00\x00\x09\x00\x00"), tag) }
39
40
  its(:frame_id) { should == 'TIT2' }
40
- its(:size) { should == 9 }
41
+ its(:size) { should == 19 }
42
+ its(:frame_size) { should == 9 }
41
43
  its(:preserve_on_altered_tag) { should == false }
42
44
  its(:preserve_on_altered_file) { should == false }
43
45
  its(:read_only) { should == false }
@@ -52,7 +54,8 @@ describe Mp3file::ID3v2::FrameHeader do
52
54
  describe("A TIT2 header with all of its flags set") do
53
55
  subject { Mp3file::ID3v2::FrameHeader.new(StringIO.new("TIT2\x00\x00\x00\x09\x00\x00"), tag) }
54
56
  its(:frame_id) { should == 'TIT2' }
55
- its(:size) { should == 9 }
57
+ its(:size) { should == 19 }
58
+ its(:frame_size) { should == 9 }
56
59
  its(:preserve_on_altered_tag) { should == false }
57
60
  its(:preserve_on_altered_file) { should == false }
58
61
  its(:read_only) { should == false }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mp3file
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Watts
@@ -82,6 +82,7 @@ extra_rdoc_files: []
82
82
  files:
83
83
  - ".gitattributes"
84
84
  - ".gitignore"
85
+ - ".travis.yml"
85
86
  - Gemfile
86
87
  - README.md
87
88
  - Rakefile