vcs_ruby 1.1.0 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/libAV/libav.rb +39 -9
- data/lib/version.info +1 -1
- metadata +1 -1
data/lib/libAV/libav.rb
CHANGED
@@ -86,8 +86,7 @@ private
|
|
86
86
|
|
87
87
|
def probe_meta_information
|
88
88
|
check_cache
|
89
|
-
parse_meta_info
|
90
|
-
return true
|
89
|
+
return parse_meta_info
|
91
90
|
rescue Exception => e
|
92
91
|
puts e
|
93
92
|
return false
|
@@ -109,35 +108,66 @@ private
|
|
109
108
|
end
|
110
109
|
|
111
110
|
def parse_meta_info
|
112
|
-
parse_format
|
113
|
-
parse_audio_streams
|
114
|
-
parse_video_streams
|
111
|
+
parse_format && parse_audio_streams && parse_video_streams
|
115
112
|
end
|
116
113
|
|
117
114
|
def parse_format
|
115
|
+
parsed = false
|
118
116
|
@cache.scan(/\[FORMAT\](.*?)\[\/FORMAT\]/m) do |format|
|
119
117
|
@info = LibAVMetaInfo.new(get_hash(format[0]))
|
118
|
+
parsed = true
|
120
119
|
end
|
120
|
+
unless parsed
|
121
|
+
@cache.scan(/\[format\](.*?)\n\n/m) do |format|
|
122
|
+
@info = LibAVMetaInfo.new(get_hash(format[0]))
|
123
|
+
parsed = true
|
124
|
+
end
|
125
|
+
end
|
126
|
+
return parsed
|
121
127
|
end
|
122
128
|
|
123
129
|
def parse_audio_streams
|
130
|
+
parsed = false
|
124
131
|
@audio_streams = []
|
125
132
|
@cache.scan(/\[STREAM\](.*?)\[\/STREAM\]/m) do |stream|
|
126
133
|
info = get_hash(stream[0])
|
127
134
|
if info['codec_type'] == 'audio'
|
128
135
|
@audio_streams << LibAVAudioStream.new(info)
|
136
|
+
parsed = true
|
129
137
|
end
|
130
138
|
end
|
139
|
+
unless parsed
|
140
|
+
@cache.scan(/\[streams.stream.\d\](.*?)\n\n/m) do |stream|
|
141
|
+
info = get_hash(stream[0])
|
142
|
+
if info['codec_type'] == 'audio'
|
143
|
+
@audio_streams << LibAVAudioStream.new(info)
|
144
|
+
parsed = true
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|
148
|
+
return parsed
|
131
149
|
end
|
132
150
|
|
133
|
-
def
|
134
|
-
|
151
|
+
def parse_audio_streams
|
152
|
+
parsed = false
|
153
|
+
@audio_streams = []
|
135
154
|
@cache.scan(/\[STREAM\](.*?)\[\/STREAM\]/m) do |stream|
|
136
155
|
info = get_hash(stream[0])
|
137
|
-
if info['codec_type'] == '
|
138
|
-
@
|
156
|
+
if info['codec_type'] == 'audio'
|
157
|
+
@audio_streams << LibAVAudioStream.new(info)
|
158
|
+
parsed = true
|
159
|
+
end
|
160
|
+
end
|
161
|
+
unless parsed
|
162
|
+
@cache.scan(/\[streams.stream.\d\](.*?)\n\n/m) do |stream|
|
163
|
+
info = get_hash(stream[0])
|
164
|
+
if info['codec_type'] == 'audio'
|
165
|
+
@audio_streams << LibAVAudioStream.new(info)
|
166
|
+
parsed = true
|
167
|
+
end
|
139
168
|
end
|
140
169
|
end
|
170
|
+
return parsed
|
141
171
|
end
|
142
172
|
end
|
143
173
|
end
|
data/lib/version.info
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.3
|