ossrs / srs

SRS is a simple, high-efficiency, real-time video server supporting RTMP, WebRTC, HLS, HTTP-FLV, SRT, MPEG-DASH, and GB28181.
https://ossrs.io
MIT License
24.72k stars 5.28k forks source link

RTMP: Do not response publish start message if hooks fail. v5.0.212 v6.0.123 #4038

Closed winlinvip closed 2 months ago

winlinvip commented 2 months ago

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.