wenjie.zhao

fix path issue.

@@ -152,10 +152,7 @@ public: @@ -152,10 +152,7 @@ public:
152 152
153 data = string(ss.data(), ss.size()) + data; 153 data = string(ss.data(), ss.size()) + data;
154 154
155 - char file_path[1024] = {0};  
156 - sprintf(file_path, "%s/%s/%sSeg1-Frag%d", _srs_config->get_hds_path(req->vhost).c_str()  
157 - , req->app.c_str(), req->stream.c_str(), index);  
158 - 155 + const char *file_path = path.c_str();
159 int fd = open(file_path, O_WRONLY | O_CREAT, S_IRWXU | S_IRGRP | S_IROTH); 156 int fd = open(file_path, O_WRONLY | O_CREAT, S_IRWXU | S_IRGRP | S_IROTH);
160 if (fd < 0) { 157 if (fd < 0) {
161 srs_error("open fragment file failed, path=%s", file_path); 158 srs_error("open fragment file failed, path=%s", file_path);
@@ -203,9 +200,11 @@ public: @@ -203,9 +200,11 @@ public:
203 */ 200 */
204 inline void set_index(int idx) 201 inline void set_index(int idx)
205 { 202 {
206 - char fg_name[1024] = {0};  
207 - sprintf(fg_name, "/var/www/live/stream0Seg1-Frag%d", idx);  
208 - path = fg_name; 203 + char file_path[1024] = {0};
  204 + sprintf(file_path, "%s/%s/%sSeg1-Frag%d", _srs_config->get_hds_path(req->vhost).c_str()
  205 + , req->app.c_str(), req->stream.c_str(), idx);
  206 +
  207 + path = file_path;
209 index = idx; 208 index = idx;
210 } 209 }
211 210