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
2015-05-24 15:19:09 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
069ee0afc3205570f77eb5a418f68b5da5f71dd0
069ee0af
1 parent
a45cf38d
fix #404, register handler then start http thread. 2.0.167.
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
26 行增加
和
12 行删除
README.md
trunk/src/app/srs_app_http_conn.cpp
trunk/src/core/srs_core.hpp
trunk/src/kernel/srs_kernel_flv.cpp
README.md
查看文件 @
069ee0a
...
...
@@ -340,6 +340,7 @@ Remark:
### SRS 2.0 history
*
v2.0, 2015-05-24, fix
[
#404
](
https://github.com/simple-rtmp-server/srs/issues/404
)
register handler then start http thread. 2.0.167.
*
v2.0, 2015-05-23, refine the thread, protocol, kbps code. 2.0.166
*
v2.0, 2015-05-23, fix
[
#391
](
https://github.com/simple-rtmp-server/srs/issues/391
)
copy request for async call.
*
v2.0, 2015-05-22, fix
[
#397
](
https://github.com/simple-rtmp-server/srs/issues/397
)
the USER_HZ maybe not 100. 2.0.165
...
...
trunk/src/app/srs_app_http_conn.cpp
查看文件 @
069ee0a
...
...
@@ -1854,17 +1854,20 @@ int SrsHttpServer::http_mount(SrsSource* s, SrsRequest* r)
sflvs
[
sid
]
=
entry
;
// start http stream cache thread
if
((
ret
=
entry
->
cache
->
start
())
!=
ERROR_SUCCESS
)
{
srs_error
(
"http: start stream cache failed. ret=%d"
,
ret
);
return
ret
;
}
// mount the http flv stream.
// we must register the handler, then start the thread,
// for the thread will cause thread switch context.
// @see https://github.com/simple-rtmp-server/srs/issues/404
if
((
ret
=
mux
.
handle
(
mount
,
entry
->
stream
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"http: mount flv stream for vhost=%s failed. ret=%d"
,
sid
.
c_str
(),
ret
);
return
ret
;
}
// start http stream cache thread
if
((
ret
=
entry
->
cache
->
start
())
!=
ERROR_SUCCESS
)
{
srs_error
(
"http: start stream cache failed. ret=%d"
,
ret
);
return
ret
;
}
srs_trace
(
"http: mount flv stream for vhost=%s, mount=%s"
,
sid
.
c_str
(),
mount
.
c_str
());
}
else
{
entry
=
sflvs
[
sid
];
...
...
trunk/src/core/srs_core.hpp
查看文件 @
069ee0a
...
...
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR 2
#define VERSION_MINOR 0
#define VERSION_REVISION 16
6
#define VERSION_REVISION 16
7
// server info.
#define RTMP_SIG_SRS_KEY "SRS"
...
...
trunk/src/kernel/srs_kernel_flv.cpp
查看文件 @
069ee0a
...
...
@@ -134,7 +134,9 @@ int SrsFlvEncoder::write_metadata(char type, char* data, int size)
tag_stream
->
write_3bytes
(
size
);
if
((
ret
=
write_tag
(
tag_header
,
sizeof
(
tag_header
),
data
,
size
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"write flv data tag failed. ret=%d"
,
ret
);
if
(
!
srs_is_client_gracefully_close
(
ret
))
{
srs_error
(
"write flv data tag failed. ret=%d"
,
ret
);
}
return
ret
;
}
...
...
@@ -168,7 +170,9 @@ int SrsFlvEncoder::write_audio(int64_t timestamp, char* data, int size)
tag_stream
->
write_1bytes
((
timestamp
>>
24
)
&
0xFF
);
if
((
ret
=
write_tag
(
tag_header
,
sizeof
(
tag_header
),
data
,
size
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"write flv audio tag failed. ret=%d"
,
ret
);
if
(
!
srs_is_client_gracefully_close
(
ret
))
{
srs_error
(
"write flv audio tag failed. ret=%d"
,
ret
);
}
return
ret
;
}
...
...
@@ -221,13 +225,17 @@ int SrsFlvEncoder::write_tag(char* header, int header_size, char* tag, int tag_s
// write tag header.
if
((
ret
=
_fs
->
write
(
header
,
header_size
,
NULL
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"write flv tag header failed. ret=%d"
,
ret
);
if
(
!
srs_is_client_gracefully_close
(
ret
))
{
srs_error
(
"write flv tag header failed. ret=%d"
,
ret
);
}
return
ret
;
}
// write tag data.
if
((
ret
=
_fs
->
write
(
tag
,
tag_size
,
NULL
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"write flv tag failed. ret=%d"
,
ret
);
if
(
!
srs_is_client_gracefully_close
(
ret
))
{
srs_error
(
"write flv tag failed. ret=%d"
,
ret
);
}
return
ret
;
}
...
...
@@ -238,7 +246,9 @@ int SrsFlvEncoder::write_tag(char* header, int header_size, char* tag, int tag_s
}
tag_stream
->
write_4bytes
(
tag_size
+
header_size
);
if
((
ret
=
_fs
->
write
(
pre_size
,
sizeof
(
pre_size
),
NULL
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"write flv previous tag size failed. ret=%d"
,
ret
);
if
(
!
srs_is_client_gracefully_close
(
ret
))
{
srs_error
(
"write flv previous tag size failed. ret=%d"
,
ret
);
}
return
ret
;
}
...
...
请
注册
或
登录
后发表评论