Update stable version to SRS 6.0
This commit is contained in:
parent
5b27c3fa7a
commit
49594b1846
|
|
@ -11,7 +11,7 @@
|
|||
[](https://codecov.io/gh/ossrs/srs)
|
||||
|
||||
SRS/7.0 ([Kai](https://ossrs.io/lts/en-us/product#release-70)) is a simple, high-efficiency, and real-time video server,
|
||||
supporting RTMP/WebRTC/HLS/HTTP-FLV/SRT/MPEG-DASH/GB28181, Linux/Windows/macOS, X86_64/ARMv7/AARCH64/M1/RISCV/LOONGARCH/MIPS,
|
||||
supporting RTMP/WebRTC/HLS/HTTP-FLV/SRT/MPEG-DASH/GB28181, Linux/macOS, X86_64/ARMv7/AARCH64/M1/RISCV/LOONGARCH/MIPS,
|
||||
and essential [features](trunk/doc/Features.md#features).
|
||||
|
||||
[](https://ossrs.net/wiki/images/SRS-SingleNode-4.0-hd.png)
|
||||
|
|
@ -62,7 +62,7 @@ To learn more about RTMP, HLS, HTTP-FLV, SRT, MPEG-DASH, WebRTC protocols, clust
|
|||
HTTP API, DVR, and transcoding, please check the documents in [English](https://ossrs.io)
|
||||
or [Chinese](https://ossrs.net).
|
||||
|
||||
If you want to use an IDE, VSCode is recommanded. VSCode supports macOS, Linux, and Windows
|
||||
If you want to use an IDE, VSCode is recommanded. VSCode supports macOS, and Linux
|
||||
platforms. The settings are ready. All you need to do is open the folder with VSCode and
|
||||
enjoy the efficiency brought by the IDE. See [VSCode README](.vscode/README.md) for details.
|
||||
|
||||
|
|
@ -99,7 +99,7 @@ who made significant contributions and maintained parts of SRS are listed below,
|
|||
* [ShiWei](https://github.com/runner365): Specializes in SRT and H.265, maintaining SRT and FLV patches for FFmpeg. An expert in codecs and FFmpeg.
|
||||
* [ChenGuanghua](https://github.com/chen-guanghua): Focused on WebRTC/QoS and introduced the Asan toolchain to SRS.
|
||||
* [LiPeng](https://github.com/lipeng19811218): Concentrates on WebRTC and contributes to memory management and smart pointers.
|
||||
* [ZhaoWenjie](https://github.com/wenjiegit): One of the earliest contributors, focusing on HDS and Windows. Has expertise in client technology.
|
||||
* [ZhaoWenjie](https://github.com/wenjiegit): One of the earliest contributors, focusing on HDS. Has expertise in client technology.
|
||||
* [WuPengqiang](https://github.com/Bepartofyou): Focused on H.265, initially contributed to the FFmpeg module in SRS for transcoding AAC with OPUS for WebRTC.
|
||||
|
||||
A huge `THANK YOU` goes out to:
|
||||
|
|
@ -118,6 +118,7 @@ distributed under their [licenses](https://ossrs.io/lts/en-us/license).
|
|||
|
||||
## Releases
|
||||
|
||||
* 2025-09-15, [Release v6.0-b1](https://github.com/ossrs/srs/releases/tag/v6.0-b1), v6.0-b1, 6.0 beta1, v6.0.177, 170611 lines.
|
||||
* 2025-08-12, [Release v6.0-b0](https://github.com/ossrs/srs/releases/tag/v6.0-b0), v6.0-b0, 6.0 beta0, v6.0.172, 170417 lines.
|
||||
* 2025-05-03, [Release v6.0-a2](https://github.com/ossrs/srs/releases/tag/v6.0-a2), v6.0-a2, 6.0 alpha2, v6.0.165, 169712 lines.
|
||||
* 2024-09-01, [Release v6.0-a1](https://github.com/ossrs/srs/releases/tag/v6.0-a1), v6.0-a1, 6.0 alpha1, v6.0.155, 169636 lines.
|
||||
|
|
|
|||
|
|
@ -1614,7 +1614,7 @@ srs_error_t SrsConfig::parse_options(int argc, char **argv)
|
|||
|
||||
// Ignore any error while detecting docker.
|
||||
if ((err = srs_detect_docker()) != srs_success) {
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
}
|
||||
|
||||
// Try to load the config if docker detect failed.
|
||||
|
|
|
|||
|
|
@ -476,7 +476,7 @@ void SrsDashController::on_unpublish()
|
|||
|
||||
if ((err = refresh_mpd(format_)) != srs_success) {
|
||||
srs_warn("Refresh the MPD failed, err=%s", srs_error_desc(err).c_str());
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -734,7 +734,7 @@ void SrsDvrSessionPlan::on_unpublish()
|
|||
srs_error_t err = segment_->close();
|
||||
if (err != srs_success) {
|
||||
srs_warn("ignore flv close error %s", srs_error_desc(err).c_str());
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
}
|
||||
|
||||
dvr_enabled_ = false;
|
||||
|
|
|
|||
|
|
@ -558,13 +558,13 @@ srs_error_t SrsEdgeIngester::do_cycle()
|
|||
string url = req_->get_stream_url();
|
||||
srs_warn("RTMP redirect %s from %s:%d to %s", url.c_str(), server.c_str(), port, redirect.c_str());
|
||||
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (srs_is_client_gracefully_close(err)) {
|
||||
srs_warn("origin disconnected, retry, error %s", srs_error_desc(err).c_str());
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -869,11 +869,11 @@ srs_error_t SrsEdgeForwarder::do_cycle()
|
|||
if (err != srs_success && srs_error_code(err) != ERROR_SOCKET_TIMEOUT) {
|
||||
srs_error("edge push get server control message failed. err=%s", srs_error_desc(err).c_str());
|
||||
send_error_code_ = srs_error_code(err);
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
continue;
|
||||
}
|
||||
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
srs_freep(msg);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ srs_error_t SrsEncoder::on_publish(ISrsRequest *req)
|
|||
// if got a loop, donot transcode the whole stream.
|
||||
if (srs_error_code(err) == ERROR_ENCODER_LOOP) {
|
||||
clear_engines();
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
}
|
||||
|
||||
// return for error or no engine.
|
||||
|
|
@ -87,7 +87,7 @@ srs_error_t SrsEncoder::cycle()
|
|||
|
||||
if ((err = do_cycle()) != srs_success) {
|
||||
srs_warn("Encoder: Ignore error, %s", srs_error_desc(err).c_str());
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
}
|
||||
|
||||
srs_usleep(SRS_RTMP_ENCODER_CIMS);
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ srs_error_t SrsForwarder::forward()
|
|||
if (err != srs_success && srs_error_code(err) != ERROR_SOCKET_TIMEOUT) {
|
||||
return srs_error_wrap(err, "receive control message");
|
||||
}
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
|
||||
srs_freep(msg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -728,7 +728,7 @@ srs_error_t SrsGoApiVhosts::serve_http(ISrsHttpResponseWriter *w, ISrsHttpMessag
|
|||
|
||||
if ((err = stat->dumps_vhosts(data)) != srs_success) {
|
||||
int code = srs_error_code(err);
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
return srs_api_response_code(w, r, code);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -738,7 +738,7 @@ srs_error_t SrsGoApiVhosts::serve_http(ISrsHttpResponseWriter *w, ISrsHttpMessag
|
|||
|
||||
if ((err = vhost->dumps(data)) != srs_success) {
|
||||
int code = srs_error_code(err);
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
return srs_api_response_code(w, r, code);
|
||||
}
|
||||
}
|
||||
|
|
@ -790,7 +790,7 @@ srs_error_t SrsGoApiStreams::serve_http(ISrsHttpResponseWriter *w, ISrsHttpMessa
|
|||
int count = srs_max(10, atoi(rcount.c_str()));
|
||||
if ((err = stat->dumps_streams(data, start, count)) != srs_success) {
|
||||
int code = srs_error_code(err);
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
return srs_api_response_code(w, r, code);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -800,7 +800,7 @@ srs_error_t SrsGoApiStreams::serve_http(ISrsHttpResponseWriter *w, ISrsHttpMessa
|
|||
|
||||
if ((err = stream->dumps(data)) != srs_success) {
|
||||
int code = srs_error_code(err);
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
return srs_api_response_code(w, r, code);
|
||||
}
|
||||
}
|
||||
|
|
@ -852,7 +852,7 @@ srs_error_t SrsGoApiClients::serve_http(ISrsHttpResponseWriter *w, ISrsHttpMessa
|
|||
int count = srs_max(10, atoi(rcount.c_str()));
|
||||
if ((err = stat->dumps_clients(data, start, count)) != srs_success) {
|
||||
int code = srs_error_code(err);
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
return srs_api_response_code(w, r, code);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -861,7 +861,7 @@ srs_error_t SrsGoApiClients::serve_http(ISrsHttpResponseWriter *w, ISrsHttpMessa
|
|||
|
||||
if ((err = client->dumps(data)) != srs_success) {
|
||||
int code = srs_error_code(err);
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
return srs_api_response_code(w, r, code);
|
||||
}
|
||||
}
|
||||
|
|
@ -920,7 +920,7 @@ srs_error_t SrsGoApiRaw::serve_http(ISrsHttpResponseWriter *w, ISrsHttpMessage *
|
|||
// query global scope.
|
||||
if ((err = _srs_config->raw_to_json(obj.get())) != srs_success) {
|
||||
int code = srs_error_code(err);
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
return srs_api_response_code(w, r, code);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -462,7 +462,7 @@ srs_error_t SrsHttpHooks::on_hls_notify(SrsContextId c, std::string url, ISrsReq
|
|||
cid.c_str(), url.c_str(), msg->status_code(), spenttime, nb_read, srs_error_desc(err).c_str());
|
||||
|
||||
// ignore any error for on_hls_notify.
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
return srs_success;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ srs_error_t SrsMpegtsOverUdp::on_udp_bytes(string host, int port, char *buf, int
|
|||
// process each ts packet
|
||||
if ((err = context_->decode(stream.get(), this)) != srs_success) {
|
||||
srs_info("parse ts packet err=%s", srs_error_desc(err).c_str());
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ srs_error_t SrsRefer::check(std::string page_url, SrsConfDirective *refer)
|
|||
return srs_success;
|
||||
}
|
||||
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
}
|
||||
|
||||
return srs_error_new(ERROR_RTMP_ACCESS_DENIED, "access denied");
|
||||
|
|
|
|||
|
|
@ -355,7 +355,7 @@ srs_error_t SrsRtcPLIWorker::cycle()
|
|||
|
||||
if ((err = handler_->do_request_keyframe(ssrc, cid)) != srs_success) {
|
||||
srs_warn("PLI error, %s", srs_error_desc(err).c_str());
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1385,7 +1385,7 @@ srs_error_t SrsRtcPublishStream::on_rtp_cipher(char *data, int nb_data)
|
|||
return srs_error_wrap(err, "on twcc");
|
||||
}
|
||||
} else {
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2591,7 +2591,7 @@ bool srs_sdp_has_h264_profile(const SrsMediaPayloadType &payload_type, const str
|
|||
|
||||
H264SpecificParam h264_param;
|
||||
if ((err = srs_parse_h264_fmtp(payload_type.format_specific_param_, h264_param)) != srs_success) {
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -2637,7 +2637,7 @@ bool srs_sdp_has_h265_profile(const SrsMediaPayloadType &payload_type, const str
|
|||
|
||||
H265SpecificParam h265_param;
|
||||
if ((err = srs_parse_h265_fmtp(payload_type.format_specific_param_, h265_param)) != srs_success) {
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -2842,7 +2842,7 @@ srs_error_t SrsRtcConnection::negotiate_publish_capability(SrsRtcUserConfig *ruc
|
|||
}
|
||||
H264SpecificParam h264_param;
|
||||
if ((err = srs_parse_h264_fmtp(payload.format_specific_param_, h264_param)) != srs_success) {
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -332,7 +332,7 @@ srs_error_t SrsRtmpConn::do_cycle()
|
|||
|
||||
// If client is redirect to other servers, we already logged the event.
|
||||
if (srs_error_code(err) == ERROR_CONTROL_REDIRECT) {
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
}
|
||||
|
||||
return err;
|
||||
|
|
@ -690,7 +690,7 @@ srs_error_t SrsRtmpConn::playing(SrsSharedPtr<SrsLiveSource> source)
|
|||
|
||||
bool accepted = false;
|
||||
if ((err = rtmp_->redirect(req, rurl, accepted)) != srs_success) {
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
} else {
|
||||
return srs_error_new(ERROR_CONTROL_REDIRECT, "redirected");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -982,10 +982,10 @@ srs_error_t SrsOriginHub::on_audio(SrsMediaPacket *shared_audio)
|
|||
if (srs_config_hls_is_on_error_ignore(hls_error_strategy)) {
|
||||
srs_warn("hls: ignore audio error %s", srs_error_desc(err).c_str());
|
||||
hls_->on_unpublish();
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
} else if (srs_config_hls_is_on_error_continue(hls_error_strategy)) {
|
||||
if (srs_hls_can_continue(srs_error_code(err), source_->meta_->ash(), msg)) {
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
} else {
|
||||
return srs_error_wrap(err, "hls: audio");
|
||||
}
|
||||
|
|
@ -996,20 +996,20 @@ srs_error_t SrsOriginHub::on_audio(SrsMediaPacket *shared_audio)
|
|||
|
||||
if ((err = dash_->on_audio(msg, format)) != srs_success) {
|
||||
srs_warn("dash: ignore audio error %s", srs_error_desc(err).c_str());
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
dash_->on_unpublish();
|
||||
}
|
||||
|
||||
if ((err = dvr_->on_audio(msg, format)) != srs_success) {
|
||||
srs_warn("dvr: ignore audio error %s", srs_error_desc(err).c_str());
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
dvr_->on_unpublish();
|
||||
}
|
||||
|
||||
#ifdef SRS_HDS
|
||||
if ((err = hds_->on_audio(msg)) != srs_success) {
|
||||
srs_warn("hds: ignore audio error %s", srs_error_desc(err).c_str());
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
hds_->on_unpublish();
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1073,10 +1073,10 @@ srs_error_t SrsOriginHub::on_video(SrsMediaPacket *shared_video, bool is_sequenc
|
|||
if (srs_config_hls_is_on_error_ignore(hls_error_strategy)) {
|
||||
srs_warn("hls: ignore video error %s", srs_error_desc(err).c_str());
|
||||
hls_->on_unpublish();
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
} else if (srs_config_hls_is_on_error_continue(hls_error_strategy)) {
|
||||
if (srs_hls_can_continue(srs_error_code(err), source_->meta_->vsh(), msg)) {
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
} else {
|
||||
return srs_error_wrap(err, "hls: video");
|
||||
}
|
||||
|
|
@ -1087,20 +1087,20 @@ srs_error_t SrsOriginHub::on_video(SrsMediaPacket *shared_video, bool is_sequenc
|
|||
|
||||
if ((err = dash_->on_video(msg, format)) != srs_success) {
|
||||
srs_warn("dash: ignore video error %s", srs_error_desc(err).c_str());
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
dash_->on_unpublish();
|
||||
}
|
||||
|
||||
if ((err = dvr_->on_video(msg, format)) != srs_success) {
|
||||
srs_warn("dvr: ignore video error %s", srs_error_desc(err).c_str());
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
dvr_->on_unpublish();
|
||||
}
|
||||
|
||||
#ifdef SRS_HDS
|
||||
if ((err = hds_->on_video(msg)) != srs_success) {
|
||||
srs_warn("hds: ignore video error %s", srs_error_desc(err).c_str());
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
hds_->on_unpublish();
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -564,7 +564,7 @@ srs_error_t SrsRtspConnection::do_cycle()
|
|||
res->status_ = SRS_CONSTS_RTSP_Forbidden;
|
||||
}
|
||||
srs_warn("RTSP: DESCRIBE failed: %s", srs_error_desc(err).c_str());
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
}
|
||||
|
||||
res->sdp_ = sdp;
|
||||
|
|
@ -590,7 +590,7 @@ srs_error_t SrsRtspConnection::do_cycle()
|
|||
res->status_ = SRS_CONSTS_RTSP_InternalServerError;
|
||||
srs_warn("RTSP: SETUP failed: %s", srs_error_desc(err).c_str());
|
||||
}
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
}
|
||||
|
||||
res->transport_->copy(req->transport_);
|
||||
|
|
|
|||
|
|
@ -1164,7 +1164,7 @@ srs_error_t SrsServer::listen_srt_mpegts()
|
|||
if ((err = acceptor->listen(ip, port)) != srs_success) {
|
||||
srs_freep(acceptor);
|
||||
srs_warn("srt listen %s:%d failed, err=%s", ip.c_str(), port, srs_error_desc(err).c_str());
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ SrsSrtRecvThread::SrsSrtRecvThread(SrsSrtConnection *srt_conn)
|
|||
SrsSrtRecvThread::~SrsSrtRecvThread()
|
||||
{
|
||||
srs_freep(trd_);
|
||||
srs_error_reset(recv_err_);
|
||||
srs_freep(recv_err_);
|
||||
}
|
||||
|
||||
srs_error_t SrsSrtRecvThread::cycle()
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ srs_error_t SrsSrtEventLoop::cycle()
|
|||
int n_fds = 0;
|
||||
if ((err = srt_poller_->wait(0, &n_fds)) != srs_success) {
|
||||
srs_warn("srt poll wait failed, n_fds=%d, err=%s", n_fds, srs_error_desc(err).c_str());
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
}
|
||||
|
||||
// We use sleep to switch to other coroutines, because the SRT poller is not possible to do this.
|
||||
|
|
|
|||
|
|
@ -338,7 +338,7 @@ srs_error_t SrsSrtFrameBuilder::on_packet(SrsSrtPacket *pkt)
|
|||
// don't handle it because SRT will, see tlpktdrop at https://ossrs.io/lts/en-us/docs/v7/doc/srt
|
||||
if ((err = ts_ctx_->decode(stream.get(), this)) != srs_success) {
|
||||
srs_warn("parse ts packet err=%s", srs_error_desc(err).c_str());
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
#define RTMP_SIG_SRS_DOMAIN "ossrs.net"
|
||||
|
||||
// The current stable release.
|
||||
#define VERSION_STABLE 5
|
||||
#define VERSION_STABLE 6
|
||||
#define VERSION_STABLE_BRANCH SRS_XSTR(VERSION_STABLE) ".0release"
|
||||
|
||||
// For platform specified headers and defines.
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ std::string SrsCplxError::description()
|
|||
if (!code_str.empty())
|
||||
ss << "(" << code_str << ")";
|
||||
|
||||
string code_longstr = srs_error_code_longstr(this);
|
||||
string code_longstr = srs_error_code_strlong(this);
|
||||
if (!code_longstr.empty())
|
||||
ss << "(" << code_longstr << ")";
|
||||
|
||||
|
|
@ -426,7 +426,7 @@ std::string SrsCplxError::error_code_str(SrsCplxError *err)
|
|||
return it->second;
|
||||
}
|
||||
|
||||
std::string SrsCplxError::error_code_longstr(SrsCplxError *err)
|
||||
std::string SrsCplxError::error_code_strlong(SrsCplxError *err)
|
||||
{
|
||||
static string not_found = "";
|
||||
static std::map<SrsErrorCode, string> error_map;
|
||||
|
|
|
|||
|
|
@ -467,7 +467,7 @@ public:
|
|||
static std::string summary(SrsCplxError *err);
|
||||
static int error_code(SrsCplxError *err);
|
||||
static std::string error_code_str(SrsCplxError *err);
|
||||
static std::string error_code_longstr(SrsCplxError *err);
|
||||
static std::string error_code_strlong(SrsCplxError *err);
|
||||
|
||||
public:
|
||||
static void srs_assert(bool expression);
|
||||
|
|
@ -482,10 +482,7 @@ public:
|
|||
#define srs_error_summary(err) SrsCplxError::summary(err)
|
||||
#define srs_error_code(err) SrsCplxError::error_code(err)
|
||||
#define srs_error_code_str(err) SrsCplxError::error_code_str(err)
|
||||
#define srs_error_code_longstr(err) SrsCplxError::error_code_longstr(err)
|
||||
#define srs_error_reset(err) \
|
||||
srs_freep(err); \
|
||||
err = srs_success
|
||||
#define srs_error_code_strlong(err) SrsCplxError::error_code_strlong(err)
|
||||
|
||||
#ifndef srs_assert
|
||||
#define srs_assert(expression) SrsCplxError::srs_assert(expression)
|
||||
|
|
|
|||
|
|
@ -2896,7 +2896,7 @@ void SrsEncFileWriter::close()
|
|||
srs_error_t err = srs_success;
|
||||
if ((err = SrsFileWriter::write(cipher.get(), nb_buf + nb_padding, NULL)) != srs_success) {
|
||||
srs_warn("ignore err %s", srs_error_desc(err).c_str());
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
}
|
||||
|
||||
nb_buf = 0;
|
||||
|
|
|
|||
|
|
@ -479,7 +479,7 @@ srs_error_t SrsRtspStack::do_recv_message(SrsRtspRequest *req)
|
|||
std::string token;
|
||||
if ((err = recv_token_normal(token)) != srs_success) {
|
||||
if (srs_error_code(err) == ERROR_RTSP_REQUEST_HEADER_EOF) {
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
break; // End of headers reached (empty line)
|
||||
}
|
||||
return srs_error_wrap(err, "recv token");
|
||||
|
|
|
|||
|
|
@ -720,7 +720,7 @@ SrsSrtSocket::~SrsSrtSocket()
|
|||
srs_error_t err = srt_poller_->del_socket(this);
|
||||
if (err != srs_success) {
|
||||
srs_error("srt poller remove socket failed, err=%s", srs_error_desc(err).c_str());
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
}
|
||||
|
||||
srs_cond_destroy(read_cond_);
|
||||
|
|
|
|||
|
|
@ -1045,7 +1045,7 @@ VOID TEST(KernelErrorTest, SrsCplxErrorCodeStrings)
|
|||
|
||||
// Test error code long string lookup
|
||||
err = srs_error_new(ERROR_SOCKET_READ, "read error");
|
||||
std::string code_longstr = srs_error_code_longstr(err);
|
||||
std::string code_longstr = srs_error_code_strlong(err);
|
||||
EXPECT_FALSE(code_longstr.empty());
|
||||
EXPECT_EQ("Socket read data failed", code_longstr);
|
||||
srs_freep(err);
|
||||
|
|
@ -1055,7 +1055,7 @@ VOID TEST(KernelErrorTest, SrsCplxErrorCodeStrings)
|
|||
EXPECT_FALSE(code_str.empty());
|
||||
EXPECT_EQ("Success", code_str);
|
||||
|
||||
code_longstr = srs_error_code_longstr(srs_success);
|
||||
code_longstr = srs_error_code_strlong(srs_success);
|
||||
EXPECT_FALSE(code_longstr.empty());
|
||||
EXPECT_EQ("Success", code_longstr);
|
||||
|
||||
|
|
@ -1067,11 +1067,11 @@ VOID TEST(KernelErrorTest, ErrorMacros)
|
|||
{
|
||||
srs_error_t err;
|
||||
|
||||
// Test srs_error_reset macro
|
||||
// Test srs_freep macro
|
||||
err = srs_error_new(ERROR_SOCKET_CONNECT, "connect failed");
|
||||
EXPECT_TRUE(err != srs_success);
|
||||
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
EXPECT_EQ(srs_success, err);
|
||||
|
||||
// Test error creation and manipulation macros
|
||||
|
|
|
|||
|
|
@ -5553,7 +5553,7 @@ VOID TEST(ProtocolRTSPTest, RTSPInvalidRequest)
|
|||
err = stack.recv_message(&req);
|
||||
EXPECT_TRUE(err != srs_success);
|
||||
srs_freep(req);
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
|
||||
bio.in_buffer.erase(bio.in_buffer.length());
|
||||
}
|
||||
|
|
@ -5569,7 +5569,7 @@ VOID TEST(ProtocolRTSPTest, RTSPInvalidRequest)
|
|||
err = stack.recv_message(&req);
|
||||
EXPECT_TRUE(err != srs_success);
|
||||
srs_freep(req);
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
|
||||
bio.in_buffer.erase(bio.in_buffer.length());
|
||||
}
|
||||
|
|
@ -5585,7 +5585,7 @@ VOID TEST(ProtocolRTSPTest, RTSPInvalidRequest)
|
|||
err = stack.recv_message(&req);
|
||||
EXPECT_TRUE(err != srs_success);
|
||||
srs_freep(req);
|
||||
srs_error_reset(err);
|
||||
srs_freep(err);
|
||||
|
||||
bio.in_buffer.erase(bio.in_buffer.length());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user