Various fixes, among which:

- Fixed segfault when attempting to initialseek on disconnected streams
- Fix 100% CPU bug in controller's stats code
- WebRTC UDP bind socket improvements
- Several segfault fixes
- Increased packet reordering buffer size from 30 to 150 packets
- Tweaks to default output/buffer behaviour for incoming pushes
- Added message for load balancer checks
- Fixed HLS content type
- Stats fixes
- Exit reason fixes
- Fixed socket IP address detection
- Fixed non-string arguments for stream settings
- Added caching for getConnectedBinHost()
- Added WebRTC playback rate control
- Added/completed VP8/VP9 support to WebRTC/RTSP
- Added live seek option to WebRTC
- Fixed seek to exactly newest timestamp
- Fixed HLS input

# Conflicts:
#	lib/defines.h
#	src/input/input.cpp
This commit is contained in:
Thulinma 2021-04-21 18:11:46 +02:00
parent 2b99f2f5ea
commit 0af992d405
75 changed files with 1512 additions and 790 deletions

View file

@ -354,7 +354,10 @@ bool RTMPStream::Chunk::Parse(Socket::Buffer &buffer){
switch (headertype){
case 0x00:
if (!buffer.available(i + 11)){return false;}// can't read whole header
if (!buffer.available(i + 11)){
DONTEVEN_MSG("Cannot read whole header");
return false;
}// can't read whole header
indata = buffer.copy(i + 11);
timestamp = indata[i++] * 256 * 256;
timestamp += indata[i++] * 256;
@ -372,7 +375,10 @@ bool RTMPStream::Chunk::Parse(Socket::Buffer &buffer){
msg_stream_id += indata[i++] * 256 * 256 * 256;
break;
case 0x40:
if (!buffer.available(i + 7)){return false;}// can't read whole header
if (!buffer.available(i + 7)){
DONTEVEN_MSG("Cannot read whole header");
return false;
}// can't read whole header
indata = buffer.copy(i + 7);
if (!allow_short){WARN_MSG("Warning: Header type 0x40 with no valid previous chunk!");}
timestamp = indata[i++] * 256 * 256;
@ -391,7 +397,10 @@ bool RTMPStream::Chunk::Parse(Socket::Buffer &buffer){
msg_stream_id = prev.msg_stream_id;
break;
case 0x80:
if (!buffer.available(i + 3)){return false;}// can't read whole header
if (!buffer.available(i + 3)){
DONTEVEN_MSG("Cannot read whole header");
return false;
}// can't read whole header
indata = buffer.copy(i + 3);
if (!allow_short){WARN_MSG("Warning: Header type 0x80 with no valid previous chunk!");}
timestamp = indata[i++] * 256 * 256;
@ -435,7 +444,10 @@ bool RTMPStream::Chunk::Parse(Socket::Buffer &buffer){
// read extended timestamp, if necessary
if (ts_header == 0x00ffffff){
if (!buffer.available(i + 4)){return false;}// can't read timestamp
if (!buffer.available(i + 4)){
DONTEVEN_MSG("Cannot read timestamp");
return false;
}// can't read timestamp
indata = buffer.copy(i + 4);
timestamp += indata[i++] * 256 * 256 * 256;
timestamp += indata[i++] * 256 * 256;
@ -447,7 +459,10 @@ bool RTMPStream::Chunk::Parse(Socket::Buffer &buffer){
// read data if length > 0, and allocate it
if (real_len > 0){
if (!buffer.available(i + real_len)){return false;}// can't read all data (yet)
if (!buffer.available(i + real_len)){
DONTEVEN_MSG("Cannot read all data yet");
return false;
}// can't read all data (yet)
buffer.remove(i); // remove the header
if (prev.len_left > 0){
data = prev.data + buffer.remove(real_len); // append the data and remove from buffer