Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2016-09-12 18:21:44 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
504352d17aba908e99f44c49f0ca2c15b284e9eb
504352d1
2 parents
c231f45f
c2cb6669
merge srs2.
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
8 行增加
和
6 行删除
trunk/src/core/srs_core.hpp
trunk/src/protocol/srs_protocol_stream.cpp
trunk/src/core/srs_core.hpp
查看文件 @
504352d
...
...
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR 3
#define VERSION_MINOR 0
#define VERSION_REVISION 21
5
#define VERSION_REVISION 21
6
// generated by configure, only macros.
#include <srs_auto_headers.hpp>
...
...
trunk/src/protocol/srs_protocol_stream.cpp
查看文件 @
504352d
...
...
@@ -146,11 +146,13 @@ int SrsFastStream::grow(ISrsBufferReader* reader, int required_size)
// the free space of buffer,
// buffer = consumed_bytes + exists_bytes + free_space.
int
nb_free_space
=
(
int
)(
buffer
+
nb_buffer
-
end
);
// the bytes already in buffer
int
nb_exists_bytes
=
(
int
)(
end
-
p
);
srs_assert
(
nb_exists_bytes
>=
0
);
// resize the space when no left space.
if
(
nb_free_space
<
required_size
)
{
// the bytes already in buffer
int
nb_exists_bytes
=
(
int
)(
end
-
p
);
srs_assert
(
nb_exists_bytes
>=
0
);
if
(
nb_free_space
<
required_size
-
nb_exists_bytes
)
{
srs_verbose
(
"move fast buffer %d bytes"
,
nb_exists_bytes
);
// reset or move to get more space.
...
...
@@ -168,7 +170,7 @@ int SrsFastStream::grow(ISrsBufferReader* reader, int required_size)
// check whether enough free space in buffer.
nb_free_space
=
(
int
)(
buffer
+
nb_buffer
-
end
);
if
(
nb_free_space
<
required_size
)
{
if
(
nb_free_space
<
required_size
-
nb_exists_bytes
)
{
ret
=
ERROR_READER_BUFFER_OVERFLOW
;
srs_error
(
"buffer overflow, required=%d, max=%d, left=%d, ret=%d"
,
required_size
,
nb_buffer
,
nb_free_space
,
ret
);
...
...
请
注册
或
登录
后发表评论