ruby-ogginfo 0.6.8 → 0.6.9
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/lib/ogg/page.rb +15 -14
- data/lib/ogginfo.rb +2 -2
- metadata +19 -10
data/History.txt
CHANGED
data/lib/ogg/page.rb
CHANGED
@@ -27,24 +27,25 @@ module Ogg
|
|
27
27
|
page = Page.new(bitstream_serial_no, granule_pos)
|
28
28
|
page.header = header
|
29
29
|
page.sequence_no = sequence_no
|
30
|
-
raise(StreamError, "got EOF when reading page") if io.eof?
|
31
30
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
if
|
43
|
-
|
31
|
+
unless io.eof?
|
32
|
+
segment_sizes = io.read(segments).unpack("C*")
|
33
|
+
if options[:skip_body]
|
34
|
+
body_size = segment_sizes.inject(0) { |sum, i| sum + i }
|
35
|
+
io.seek(body_size, IO::SEEK_CUR)
|
36
|
+
else
|
37
|
+
segment_sizes.each do |size|
|
38
|
+
break if io.eof?
|
39
|
+
page.segments << io.read(size)
|
40
|
+
end
|
41
|
+
if options[:checksum]
|
42
|
+
if @checksum != Ogg.compute_checksum(page.pack)
|
43
|
+
raise(StreamError, "bad checksum: expected #{ @checksum }, got #{ page.checksum }")
|
44
|
+
end
|
44
45
|
end
|
45
46
|
end
|
46
47
|
end
|
47
|
-
|
48
|
+
|
48
49
|
page
|
49
50
|
end
|
50
51
|
|
data/lib/ogginfo.rb
CHANGED
@@ -25,7 +25,7 @@ end
|
|
25
25
|
class OggInfoError < StandardError ; end
|
26
26
|
|
27
27
|
class OggInfo
|
28
|
-
VERSION = "0.6.
|
28
|
+
VERSION = "0.6.9"
|
29
29
|
extend Forwardable
|
30
30
|
include Ogg
|
31
31
|
|
@@ -44,7 +44,7 @@ class OggInfo
|
|
44
44
|
@length = nil
|
45
45
|
@bitrate = nil
|
46
46
|
filesize = File.size(@filename)
|
47
|
-
File.open(@filename) do |file|
|
47
|
+
File.open(@filename, 'rb') do |file|
|
48
48
|
begin
|
49
49
|
info = read_headers(file)
|
50
50
|
@samplerate = info[:samplerate]
|
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.6.
|
4
|
+
version: 0.6.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,12 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
14
|
-
default_executable:
|
13
|
+
date: 2012-05-18 00:00:00.000000000Z
|
15
14
|
dependencies:
|
16
15
|
- !ruby/object:Gem::Dependency
|
17
16
|
name: rdoc
|
18
|
-
requirement: &
|
17
|
+
requirement: &73429950 !ruby/object:Gem::Requirement
|
19
18
|
none: false
|
20
19
|
requirements:
|
21
20
|
- - ~>
|
@@ -23,18 +22,29 @@ dependencies:
|
|
23
22
|
version: '3.10'
|
24
23
|
type: :development
|
25
24
|
prerelease: false
|
26
|
-
version_requirements: *
|
25
|
+
version_requirements: *73429950
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: rcov
|
28
|
+
requirement: &73429430 !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.9'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: *73429430
|
27
37
|
- !ruby/object:Gem::Dependency
|
28
38
|
name: hoe
|
29
|
-
requirement: &
|
39
|
+
requirement: &73429100 !ruby/object:Gem::Requirement
|
30
40
|
none: false
|
31
41
|
requirements:
|
32
42
|
- - ~>
|
33
43
|
- !ruby/object:Gem::Version
|
34
|
-
version: '
|
44
|
+
version: '3.0'
|
35
45
|
type: :development
|
36
46
|
prerelease: false
|
37
|
-
version_requirements: *
|
47
|
+
version_requirements: *73429100
|
38
48
|
description: ! 'ruby-ogginfo gives you access to low level information on ogg files
|
39
49
|
|
40
50
|
(bitrate, length, samplerate, encoder, etc... ), as well as tag.
|
@@ -66,7 +76,6 @@ files:
|
|
66
76
|
- test/test_ruby-ogginfo.rb
|
67
77
|
- test/test_ruby-spxinfo.rb
|
68
78
|
- .gemtest
|
69
|
-
has_rdoc: true
|
70
79
|
homepage: http://ruby-ogginfo.rubyforge.org/
|
71
80
|
licenses: []
|
72
81
|
post_install_message:
|
@@ -89,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
98
|
version: '0'
|
90
99
|
requirements: []
|
91
100
|
rubyforge_project: ruby-ogginfo
|
92
|
-
rubygems_version: 1.
|
101
|
+
rubygems_version: 1.8.17
|
93
102
|
signing_key:
|
94
103
|
specification_version: 3
|
95
104
|
summary: ruby-ogginfo gives you access to low level information on ogg files (bitrate,
|