Object
Reads pages and packets from an ogg stream
# File lib/ogg/reader.rb, line 10 def each_pages(options = {}) until @input.eof? yield Page.read(@input, options) end end
# File lib/ogg/reader.rb, line 16 def read_packets(max_packets) result = [] partial_packet = "" each_pages do |page| partial_packet = page.segments.inject(partial_packet) do |packet,segment| packet << segment if segment.length < 255 #end of packet result << packet return result if result.length == max_packets "" else packet end end end # We expect packets to reach page boundaries, consider raising exception if partial_packet here. result end
Generated with the Darkfish Rdoc Generator 2.