diff --git a/trunk/src/rtmp/srs_protocol_buffer.cpp b/trunk/src/rtmp/srs_protocol_buffer.cpp index 82ef77f37..d222e62c9 100644 --- a/trunk/src/rtmp/srs_protocol_buffer.cpp +++ b/trunk/src/rtmp/srs_protocol_buffer.cpp @@ -200,25 +200,6 @@ void SrsFastBuffer::set_merge_read(bool v, int max_buffer, IMergeReadHandler* ha } #endif -void SrsFastBuffer::on_chunk_size(int32_t chunk_size) -{ - if (nb_buffer >= chunk_size) { - return; - } - - // limit the max buffer. - int buffer_size = srs_min(chunk_size, SRS_MR_SOCKET_BUFFER); - - if (buffer_size != nb_buffer) { - reset_buffer(buffer_size); - } -} - -int SrsFastBuffer::buffer_size() -{ - return nb_buffer; -} - void SrsFastBuffer::reset_buffer(int size) { // remember the cap. diff --git a/trunk/src/rtmp/srs_protocol_buffer.hpp b/trunk/src/rtmp/srs_protocol_buffer.hpp index 1e4a8375a..bb9f69cc1 100644 --- a/trunk/src/rtmp/srs_protocol_buffer.hpp +++ b/trunk/src/rtmp/srs_protocol_buffer.hpp @@ -163,17 +163,6 @@ public: */ virtual void set_merge_read(bool v, int max_buffer, IMergeReadHandler* handler); #endif -public: - /** - * when chunk size changed, the buffer should change the buffer also. - * to keep the socket buffer size always greater than chunk size. - * @see https://github.com/winlinvip/simple-rtmp-server/issues/241 - */ - virtual void on_chunk_size(int32_t chunk_size); - /** - * get the size of socket buffer to read. - */ - virtual int buffer_size(); private: virtual void reset_buffer(int size); }; diff --git a/trunk/src/rtmp/srs_protocol_stack.cpp b/trunk/src/rtmp/srs_protocol_stack.cpp index 03d9e5e7d..10ece0e0d 100644 --- a/trunk/src/rtmp/srs_protocol_stack.cpp +++ b/trunk/src/rtmp/srs_protocol_stack.cpp @@ -1708,11 +1708,8 @@ int SrsProtocol::on_recv_message(SrsMessage* msg) SRS_CONSTS_RTMP_MAX_CHUNK_SIZE); } - int sock_buffer = in_buffer->buffer_size(); in_chunk_size = pkt->chunk_size; - in_buffer->on_chunk_size(pkt->chunk_size); - srs_trace("input chunk size to %d, sock buf %d=>%d", - pkt->chunk_size, sock_buffer, in_buffer->buffer_size()); + srs_trace("input chunk size to %d", pkt->chunk_size); break; }