mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
response the call message with null. 0.9.137
This commit is contained in:
parent
4843c525b4
commit
fea8755719
6 changed files with 291 additions and 1 deletions
|
@ -51,6 +51,7 @@ using namespace std;
|
|||
#include <srs_protocol_utility.hpp>
|
||||
#include <srs_kernel_utility.hpp>
|
||||
#include <srs_protocol_msg_array.hpp>
|
||||
#include <srs_protocol_amf0.hpp>
|
||||
|
||||
// when stream is busy, for example, streaming is already
|
||||
// publishing, when a new client to request to publish,
|
||||
|
@ -852,6 +853,22 @@ int SrsRtmpConn::process_play_control_msg(SrsConsumer* consumer, SrsMessage* msg
|
|||
return ret;
|
||||
}
|
||||
|
||||
// call msg,
|
||||
// support response null first,
|
||||
// @see https://github.com/winlinvip/simple-rtmp-server/issues/106
|
||||
SrsCallPacket* call = dynamic_cast<SrsCallPacket*>(pkt);
|
||||
if (call) {
|
||||
SrsCallResPacket* res = new SrsCallResPacket(call->transaction_id);
|
||||
res->command_object = SrsAmf0Any::null();
|
||||
res->response = SrsAmf0Any::null();
|
||||
if ((ret = rtmp->send_and_free_packet(res, 0)) != ERROR_SUCCESS) {
|
||||
srs_warn("response call failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
// pause or other msg.
|
||||
SrsPausePacket* pause = dynamic_cast<SrsPausePacket*>(pkt);
|
||||
if (!pause) {
|
||||
srs_info("ignore all amf0/amf3 command except pause.");
|
||||
|
|
|
@ -926,6 +926,10 @@ int SrsSource::on_meta_data(SrsMessage* msg, SrsOnMetaDataPacket* metadata)
|
|||
metadata->metadata->set("server", SrsAmf0Any::str(RTMP_SIG_SRS_KEY" "RTMP_SIG_SRS_VERSION" ("RTMP_SIG_SRS_URL_SHORT")"));
|
||||
metadata->metadata->set("authors", SrsAmf0Any::str(RTMP_SIG_SRS_PRIMARY_AUTHROS));
|
||||
|
||||
// version, for example, 1.0.0
|
||||
// add version to metadata, please donot remove it, for debug.
|
||||
metadata->metadata->set("server_version", SrsAmf0Any::str(RTMP_SIG_SRS_VERSION));
|
||||
|
||||
if ((prop = metadata->metadata->get_property("audiosamplerate")) != NULL) {
|
||||
if (prop->is_number()) {
|
||||
sample_rate = (int)prop->to_number();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue