rtmp-stream: Change TEST_FRAMEDROPS to just sleep
Instead of making the send buffer size super small, just do a sleep when sending data to simulate the inability to send out as much data as desired.
This commit is contained in:
parent
118e3edd18
commit
be2b0d1398
@ -193,6 +193,9 @@ static int send_packet(struct rtmp_stream *stream,
|
||||
int ret = 0;
|
||||
|
||||
flv_packet_mux(packet, &data, &size, is_header);
|
||||
#ifdef TEST_FRAMEDROPS
|
||||
os_sleep_ms(rand() % 40);
|
||||
#endif
|
||||
ret = RTMP_Write(&stream->rtmp, (char*)data, (int)size);
|
||||
bfree(data);
|
||||
|
||||
@ -316,15 +319,11 @@ static void adjust_sndbuf_size(struct rtmp_stream *stream, int new_size)
|
||||
int cur_sendbuf_size = new_size;
|
||||
socklen_t int_size = sizeof(int);
|
||||
|
||||
#ifndef TEST_FRAMEDROPS
|
||||
getsockopt(stream->rtmp.m_sb.sb_socket, SOL_SOCKET, SO_SNDBUF,
|
||||
(char*)&cur_sendbuf_size, &int_size);
|
||||
|
||||
if (cur_sendbuf_size < new_size) {
|
||||
cur_sendbuf_size = new_size;
|
||||
#else
|
||||
{cur_sendbuf_size = 1024*8;
|
||||
#endif
|
||||
setsockopt(stream->rtmp.m_sb.sb_socket, SOL_SOCKET, SO_SNDBUF,
|
||||
(const char*)&cur_sendbuf_size, int_size);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user