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-01-22 13:16:54 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7d86c6d9e94cffd8278f86bbe0dab993e81649c0
7d86c6d9
1 parent
2167a838
for bug #293, refine for fast cache of http stream.
显示空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
20 行增加
和
4 行删除
trunk/conf/full.conf
trunk/src/app/srs_app_config.hpp
trunk/src/app/srs_app_http_conn.cpp
trunk/conf/full.conf
查看文件 @
7d86c6d
...
...
@@ -387,7 +387,8 @@ vhost http.remux.srs.com {
# the fast cache for audio stream(mp3/aac),
# to cache more audio and send to client in a time to make android(weixin) happy.
# @remark the flv stream ignore it
# default: 30
# @remark 0 to disable fast cache for http audio stream.
# default: 0
fast_cache
30
;
# the stream mout for rtmp to remux to flv live streaming.
# typical mount to [vhost]/[app]/[stream].flv
...
...
trunk/src/app/srs_app_config.hpp
查看文件 @
7d86c6d
...
...
@@ -68,7 +68,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define SRS_CONF_DEFAULT_HTTP_MOUNT "[vhost]/"
#define SRS_CONF_DEFAULT_HTTP_REMUX_MOUNT "[vhost]/[app]/[stream].flv"
#define SRS_CONF_DEFAULT_HTTP_DIR SRS_CONF_DEFAULT_HLS_PATH
#define SRS_CONF_DEFAULT_HTTP_AUDIO_FAST_CACHE
3
0
#define SRS_CONF_DEFAULT_HTTP_AUDIO_FAST_CACHE 0
#define SRS_CONF_DEFAULT_HTTP_STREAM_PORT 8080
#define SRS_CONF_DEFAULT_HTTP_API_PORT 1985
...
...
trunk/src/app/srs_app_http_conn.cpp
查看文件 @
7d86c6d
...
...
@@ -166,12 +166,20 @@ int SrsStreamCache::dump_cache(SrsConsumer* consumer)
{
int
ret
=
ERROR_SUCCESS
;
double
fast_cache
=
_srs_config
->
get_vhost_http_remux_fast_cache
(
req
->
vhost
);
if
(
fast_cache
<=
0
)
{
srs_info
(
"http: ignore dump fast cache."
);
return
ret
;
}
// TODO: FIXME: config it.
if
((
ret
=
queue
->
dump_packets
(
consumer
,
false
,
0
,
0
,
SrsRtmpJitterAlgorithmOFF
))
!=
ERROR_SUCCESS
)
{
return
ret
;
}
srs_trace
(
"http: dump cache %d msgs, duration=%dms, cache=%.2fs"
,
queue
->
size
(),
queue
->
duration
(),
_srs_config
->
get_vhost_http_remux_fast_cache
(
req
->
vhost
)
);
queue
->
size
(),
queue
->
duration
(),
fast_cache
);
return
ret
;
}
...
...
@@ -191,7 +199,10 @@ int SrsStreamCache::cycle()
// TODO: FIMXE: add pithy print.
// TODO: FIXME: support reload.
queue
->
set_queue_size
(
_srs_config
->
get_vhost_http_remux_fast_cache
(
req
->
vhost
));
double
fast_cache
=
_srs_config
->
get_vhost_http_remux_fast_cache
(
req
->
vhost
);
if
(
fast_cache
>
0
)
{
queue
->
set_queue_size
(
fast_cache
);
}
while
(
true
)
{
// get messages from consumer.
...
...
@@ -216,7 +227,11 @@ int SrsStreamCache::cycle()
// free the messages.
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
SrsSharedPtrMessage
*
msg
=
msgs
.
msgs
[
i
];
if
(
fast_cache
>
0
)
{
queue
->
enqueue
(
msg
);
}
else
{
srs_freep
(
msg
);
}
}
}
...
...
请
注册
或
登录
后发表评论