mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
parent
346cc96d7a
commit
75530efbc4
5 changed files with 34 additions and 24 deletions
|
@ -54,12 +54,7 @@ srs_error_t SrsLatestVersion::start()
|
|||
return srs_success;
|
||||
}
|
||||
|
||||
char buf[10];
|
||||
srs_random_generate(buf, sizeof(buf));
|
||||
for (int i = 0; i < (int)sizeof(buf); i++) {
|
||||
buf[i] = 'a' + uint8_t(buf[i])%25;
|
||||
}
|
||||
server_id_ = string(buf, sizeof(buf));
|
||||
server_id_ = srs_random_str(10);
|
||||
|
||||
return trd_->start();
|
||||
}
|
||||
|
|
|
@ -944,6 +944,11 @@ srs_error_t SrsRtmpConn::acquire_publish(SrsLiveSource* source)
|
|||
|
||||
SrsRequest* req = info->req;
|
||||
|
||||
// Check whether RTMP stream is busy.
|
||||
if (!source->can_publish(info->edge)) {
|
||||
return srs_error_new(ERROR_SYSTEM_STREAM_BUSY, "rtmp: stream %s is busy", req->get_stream_url().c_str());
|
||||
}
|
||||
|
||||
// Check whether RTC stream is busy.
|
||||
#ifdef SRS_RTC
|
||||
SrsRtcSource *rtc = NULL;
|
||||
|
@ -955,16 +960,11 @@ srs_error_t SrsRtmpConn::acquire_publish(SrsLiveSource* source)
|
|||
}
|
||||
|
||||
if (!rtc->can_publish()) {
|
||||
return srs_error_new(ERROR_RTC_SOURCE_BUSY, "rtc stream %s busy", req->get_stream_url().c_str());
|
||||
return srs_error_new(ERROR_SYSTEM_STREAM_BUSY, "rtc stream %s busy", req->get_stream_url().c_str());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Check whether RTMP stream is busy.
|
||||
if (!source->can_publish(info->edge)) {
|
||||
return srs_error_new(ERROR_SYSTEM_STREAM_BUSY, "rtmp: stream %s is busy", req->get_stream_url().c_str());
|
||||
}
|
||||
|
||||
// Bridge to RTC streaming.
|
||||
#if defined(SRS_RTC) && defined(SRS_FFMPEG_FIT)
|
||||
if (rtc) {
|
||||
|
|
|
@ -9,6 +9,6 @@
|
|||
|
||||
#define VERSION_MAJOR 4
|
||||
#define VERSION_MINOR 0
|
||||
#define VERSION_REVISION 136
|
||||
#define VERSION_REVISION 137
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue