mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
RTMP: Do not response publish start message if hooks fail. v5.0.212 v6.0.123 (#4038)
Fix #4037 SRS should not send the publish start message `onStatus(NetStream.Publish.Start)` if hooks fail, which causes OBS to repeatedly reconnect. Note that this fix does not send an RTMP error message when publishing fails, because neither OBS nor FFmpeg process this specific error message; they only display a general error. Apart from the order of messages, nothing else has been changed. Previously, we sent the publish start message `onStatus(NetStream.Publish.Start)` before the HTTP hook `on_publish`; now, we have modified it to send this message after the HTTP hook.
This commit is contained in:
parent
5eb802daca
commit
37f0faae5a
7 changed files with 38 additions and 31 deletions
|
@ -1002,6 +1002,11 @@ srs_error_t SrsRtmpConn::do_publishing(SrsLiveSource* source, SrsPublishRecvThre
|
|||
->attr("timeout", srs_fmt("%d", srsu2msi(publish_normal_timeout)))->end();
|
||||
SrsAutoFree(ISrsApmSpan, span);
|
||||
#endif
|
||||
|
||||
// Response the start publishing message, let client start to publish messages.
|
||||
if ((err = rtmp->start_publishing(info->res->stream_id)) != srs_success) {
|
||||
return srs_error_wrap(err, "start publishing");
|
||||
}
|
||||
|
||||
int64_t nb_msgs = 0;
|
||||
uint64_t nb_frames = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue