mirror of
https://github.com/TakeV-Lambda/dino.git
synced 2024-11-23 15:34:58 +00:00
SRTP: Drop unnecessary buffer copy
This commit is contained in:
parent
78bb2bbdda
commit
474512e9d1
1 changed files with 4 additions and 6 deletions
|
@ -34,9 +34,8 @@ public class Session {
|
|||
if (res != ErrorStatus.ok) {
|
||||
throw new Error.UNKNOWN(@"SRTP encrypt failed: $res");
|
||||
}
|
||||
uint8[] ret = new uint8[buf_use];
|
||||
GLib.Memory.copy(ret, buf, buf_use);
|
||||
return ret;
|
||||
buf.length = buf_use;
|
||||
return buf;
|
||||
}
|
||||
|
||||
public uint8[] decrypt_rtp(uint8[] data) throws Error {
|
||||
|
@ -65,9 +64,8 @@ public class Session {
|
|||
if (res != ErrorStatus.ok) {
|
||||
throw new Error.UNKNOWN(@"SRTCP encrypt failed: $res");
|
||||
}
|
||||
uint8[] ret = new uint8[buf_use];
|
||||
GLib.Memory.copy(ret, buf, buf_use);
|
||||
return ret;
|
||||
buf.length = buf_use;
|
||||
return buf;
|
||||
}
|
||||
|
||||
public uint8[] decrypt_rtcp(uint8[] data) throws Error {
|
||||
|
|
Loading…
Reference in a new issue