1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

chunk size default to 60000, high performance. set chunk size when forward

This commit is contained in:
winlin 2014-01-01 21:39:06 +08:00
parent 4d631d749f
commit 993c5daec7
3 changed files with 37 additions and 4 deletions

View file

@ -57,7 +57,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// the interval in seconds for bandwidth check
#define SRS_CONF_DEFAULT_BANDWIDTH_LIMIT_KBPS 1000
#define SRS_CONF_DEFAULT_CHUNK_SIZE 4096
// the default chunk size for system.
#define SRS_CONF_DEFAULT_CHUNK_SIZE 60000
#define SRS_STAGE_PLAY_USER_INTERVAL_MS 1300
#define SRS_STAGE_PUBLISH_USER_INTERVAL_MS 1100

View file

@ -391,12 +391,44 @@ int SrsRtmpClient::play(string stream, int stream_id)
}
}
// SetChunkSize
if (true) {
SrsCommonMessage* msg = new SrsCommonMessage();
SrsSetChunkSizePacket* pkt = new SrsSetChunkSizePacket();
pkt->chunk_size = SRS_CONF_DEFAULT_CHUNK_SIZE;
msg->set_packet(pkt, 0);
if ((ret = protocol->send_message(msg)) != ERROR_SUCCESS) {
srs_error("send set chunk size failed. "
"stream=%s, chunk_size=%d, ret=%d",
stream.c_str(), SRS_CONF_DEFAULT_CHUNK_SIZE, ret);
return ret;
}
}
return ret;
}
int SrsRtmpClient::publish(string stream, int stream_id)
{
int ret = ERROR_SUCCESS;
// SetChunkSize
if (true) {
SrsCommonMessage* msg = new SrsCommonMessage();
SrsSetChunkSizePacket* pkt = new SrsSetChunkSizePacket();
pkt->chunk_size = SRS_CONF_DEFAULT_CHUNK_SIZE;
msg->set_packet(pkt, 0);
if ((ret = protocol->send_message(msg)) != ERROR_SUCCESS) {
srs_error("send set chunk size failed. "
"stream=%s, chunk_size=%d, ret=%d",
stream.c_str(), SRS_CONF_DEFAULT_CHUNK_SIZE, ret);
return ret;
}
}
// publish(stream)
if (true) {