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
2014-12-04 15:45:25 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
159ef3823c367c73c74e554a00aa2508c82fa76e
159ef382
1 parent
a23b5b9a
for bug#241, simplify the buffer, donot realloc it.
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
3 行增加
和
24 行删除
trunk/src/rtmp/srs_protocol_buffer.cpp
trunk/src/rtmp/srs_protocol_buffer.hpp
trunk/src/rtmp/srs_protocol_buffer.cpp
查看文件 @
159ef38
...
...
@@ -90,10 +90,9 @@ SrsFastBuffer::SrsFastBuffer()
_handler
=
NULL
;
#endif
p
=
end
=
buffer
=
NULL
;
nb_buffer
=
0
;
reset_buffer
(
SRS_MR_SOCKET_BUFFER
);
nb_buffer
=
SRS_MR_SOCKET_BUFFER
;
buffer
=
new
char
[
nb_buffer
];
p
=
end
=
buffer
;
}
SrsFastBuffer
::~
SrsFastBuffer
()
...
...
@@ -193,21 +192,3 @@ void SrsFastBuffer::set_merge_read(bool v, IMergeReadHandler* handler)
}
#endif
void
SrsFastBuffer
::
reset_buffer
(
int
size
)
{
// remember the cap.
int
nb_cap
=
end
-
p
;
// atleast to put the old data.
nb_buffer
=
srs_max
(
nb_cap
,
size
);
// copy old data to buf.
char
*
buf
=
new
char
[
nb_buffer
];
if
(
nb_cap
>
0
)
{
memcpy
(
buf
,
p
,
nb_cap
);
}
srs_freep
(
buffer
);
p
=
buffer
=
buf
;
end
=
p
+
nb_cap
;
}
...
...
trunk/src/rtmp/srs_protocol_buffer.hpp
查看文件 @
159ef38
...
...
@@ -162,8 +162,6 @@ public:
*/
virtual
void
set_merge_read
(
bool
v
,
IMergeReadHandler
*
handler
);
#endif
private
:
virtual
void
reset_buffer
(
int
size
);
};
#endif
...
...
请
注册
或
登录
后发表评论