ruby-ogginfo 0.4 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/History.txt +8 -0
  2. data/lib/ogginfo.rb +4 -3
  3. metadata +2 -2
data/History.txt CHANGED
@@ -1,3 +1,11 @@
1
+ === 0.4.2 / 2010-03-13
2
+
3
+ * bugfix on frame parsing
4
+
5
+ === 0.4.1 / 2010-03-13
6
+
7
+ * bugfix on file parsing
8
+
1
9
  === 0.4 / 2009-12-04
2
10
 
3
11
  * new ogg frame reading implementation
data/lib/ogginfo.rb CHANGED
@@ -23,7 +23,7 @@ end
23
23
  class OggInfoError < StandardError ; end
24
24
 
25
25
  class OggInfo
26
- VERSION = "0.4"
26
+ VERSION = "0.4.2"
27
27
  CHECKSUM_TABLE = [
28
28
  0x00000000,0x04c11db7,0x09823b6e,0x0d4326d9,
29
29
  0x130476dc,0x17c56b6b,0x1a864db2,0x1e475005,
@@ -159,6 +159,7 @@ class OggInfo
159
159
 
160
160
  return nil if file.eof?
161
161
  chunk = file.read(27)
162
+ raise OggInfoError if file.eof?
162
163
 
163
164
  capture_pattern,
164
165
  frame[:version],
@@ -172,10 +173,10 @@ class OggInfo
172
173
  if capture_pattern != "OggS"
173
174
  raise(OggInfoError, "bad magic number '#{capture_pattern}'")
174
175
  end
175
-
176
+
176
177
  segment_sizes = file.read(frame[:page_segments]).unpack("C*")
177
- frame[:header_size] = 27 + frame[:page_segments]
178
178
  frame[:body_size] = segment_sizes.inject(0) { |sum, i| sum += i }
179
+ frame[:header_size] = 27 + frame[:page_segments]
179
180
  frame[:size] = frame[:header_size] + frame[:body_size]
180
181
  file.seek(frame[:body_size], IO::SEEK_CUR)
181
182
  frame
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-ogginfo
3
3
  version: !ruby/object:Gem::Version
4
- version: "0.4"
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillaume Pierronnet
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-04 00:00:00 +01:00
12
+ date: 2010-03-13 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency