Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Support for decoding missing packets
  • Loading branch information
dafoxia committed Jun 14, 2014
commit c2d4f0e4d40a5807de53eb3715bb9b52d2bdf990
6 changes: 5 additions & 1 deletion lib/opus-ruby/decoder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def decode( data )
#@frame_size = Opus.opus_packet_get_samples_per_frame packet, @sample_rate
#max_size = @frame_size * @channels
# since calculation runs wrong, set it to max. framesize that should occur.
max_size = 2880
max_size = 5760 #2880
decoded = FFI::MemoryPointer.new :short, max_size + 1

frame_size = Opus.opus_decode @decoder, packet, len, decoded, max_size, 0
Expand All @@ -67,6 +67,10 @@ def decode( data )
end
return decoded.read_string_length frame_size * 2
end

def decode_missed
Opus.opus_decode @decoder, nil, 0, nil, 0, 0
end

def get_lasterror_code
return @lasterror
Expand Down