Skip to content

Commit

Permalink
add length for each opus packet
Browse files Browse the repository at this point in the history
  • Loading branch information
volvet committed Feb 21, 2016
1 parent 5135e78 commit 05ced10
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions rtp_opus_extractor.lua
Expand Up @@ -55,7 +55,18 @@ do
end
end
local function writebytes(f,x)
local b1=string.char(x%256) x=(x-x%256)/256
local b2=string.char(x%256) x=(x-x%256)/256
local b3=string.char(x%256) x=(x-x%256)/256
local b4=string.char(x%256) x=(x-x%256)/256
f:write(b1,b2,b3,b4)
end
local function on_ordered_opus_payload(seq, opus_data)
length = opus_data:tvb():len()
--log("Opus packet length = "..tostring(length).."formated:"..string.format("%04x", length))
writebytes(fp, length)
fp:write(opus_data:tvb()():raw())
fp:flush()
end
Expand Down

0 comments on commit 05ced10

Please sign in to comment.