1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

for #340, refine ts prefix code.

This commit is contained in:
wenjie.zhao 2015-03-13 02:01:24 +08:00
parent 5969f72354
commit 65f404fb42
2 changed files with 6 additions and 7 deletions

View file

@ -9,7 +9,6 @@ vhost __defaultVhost__ {
enabled on;
hls_fragment 10;
hls_window 60;
# hls_entry_prefix http://127.0.0.1/;
hls_path ./objs/nginx/html;
}
}

View file

@ -3152,17 +3152,17 @@ string SrsConfig::get_hls_entry_prefix(string vhost)
return "";
}
std::string hls_entry_prefix = conf->arg0();
if (hls_entry_prefix.empty()) {
std::string prefix = conf->arg0();
if (prefix.empty()) {
return "";
}
char last_char = hls_entry_prefix[hls_entry_prefix.length() - 1];
if (last_char != '/') {
hls_entry_prefix.append("/");
const char last = prefix[prefix.length() - 1];
if (last != '/') {
return prefix.append("/");
}
return hls_entry_prefix;
return prefix;
}
string SrsConfig::get_hls_path(string vhost)