mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Refine play consume message for RTC
This commit is contained in:
parent
170b7453f4
commit
b0566d51ef
1 changed files with 13 additions and 10 deletions
|
@ -701,14 +701,8 @@ srs_error_t SrsRtcSenderThread::cycle()
|
|||
return srs_error_wrap(err, "rtc sender thread");
|
||||
}
|
||||
|
||||
int msg_count = 0;
|
||||
if ((err = consumer->dump_packets(&msgs, msg_count)) != srs_success) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// For RTC, we always try to read messages, only wait when no message.
|
||||
if (msg_count <= 0) {
|
||||
#ifdef SRS_PERF_QUEUE_COND_WAIT
|
||||
// Wait for amount of messages or a duration.
|
||||
if (realtime) {
|
||||
// for realtime, min required msgs is 0, send when got one+ msgs.
|
||||
consumer->wait(SRS_PERF_MW_MIN_MSGS_FOR_RTC_REALTIME, mw_sleep);
|
||||
|
@ -716,7 +710,16 @@ srs_error_t SrsRtcSenderThread::cycle()
|
|||
// for no-realtime, got some msgs then send.
|
||||
consumer->wait(SRS_PERF_MW_MIN_MSGS_FOR_RTC, mw_sleep);
|
||||
}
|
||||
#else
|
||||
#endif
|
||||
|
||||
// Try to read some messages.
|
||||
int msg_count = 0;
|
||||
if ((err = consumer->dump_packets(&msgs, msg_count)) != srs_success) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (msg_count <= 0) {
|
||||
#ifndef SRS_PERF_QUEUE_COND_WAIT
|
||||
srs_usleep(mw_sleep);
|
||||
#endif
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue