wenjie.zhao

for #340, refine ts prefix code.

@@ -9,7 +9,6 @@ vhost __defaultVhost__ { @@ -9,7 +9,6 @@ vhost __defaultVhost__ {
9 enabled on; 9 enabled on;
10 hls_fragment 10; 10 hls_fragment 10;
11 hls_window 60; 11 hls_window 60;
12 - # hls_entry_prefix http://127.0.0.1/;  
13 hls_path ./objs/nginx/html; 12 hls_path ./objs/nginx/html;
14 } 13 }
15 } 14 }
@@ -3152,17 +3152,17 @@ string SrsConfig::get_hls_entry_prefix(string vhost) @@ -3152,17 +3152,17 @@ string SrsConfig::get_hls_entry_prefix(string vhost)
3152 return ""; 3152 return "";
3153 } 3153 }
3154 3154
3155 - std::string hls_entry_prefix = conf->arg0();  
3156 - if (hls_entry_prefix.empty()) { 3155 + std::string prefix = conf->arg0();
  3156 + if (prefix.empty()) {
3157 return ""; 3157 return "";
3158 } 3158 }
3159 3159
3160 - char last_char = hls_entry_prefix[hls_entry_prefix.length() - 1];  
3161 - if (last_char != '/') {  
3162 - hls_entry_prefix.append("/"); 3160 + const char last = prefix[prefix.length() - 1];
  3161 + if (last != '/') {
  3162 + return prefix.append("/");
3163 } 3163 }
3164 3164
3165 - return hls_entry_prefix; 3165 + return prefix;
3166 } 3166 }
3167 3167
3168 string SrsConfig::get_hls_path(string vhost) 3168 string SrsConfig::get_hls_path(string vhost)