mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
add: hls configuration adds [duration] variable (#1083)
This commit is contained in:
parent
c20b819a29
commit
aaf2905a9d
3 changed files with 17 additions and 3 deletions
|
@ -688,7 +688,14 @@ srs_error_t SrsHlsMuxer::_refresh_m3u8(string m3u8_file)
|
|||
ss << "#EXTINF:" << segment->duration() / 1000.0 << ", no desc" << SRS_CONSTS_LF;
|
||||
|
||||
// {file name}\n
|
||||
ss << segment->uri << SRS_CONSTS_LF;
|
||||
std::string seg_uri = segment->uri;
|
||||
if (true) {
|
||||
std::stringstream stemp;
|
||||
stemp << (int)(segment->duration());
|
||||
seg_uri = srs_string_replace(seg_uri, "[duration]", stemp.str());
|
||||
}
|
||||
//ss << segment->uri << SRS_CONSTS_LF;
|
||||
ss << seg_uri << SRS_CONSTS_LF;
|
||||
}
|
||||
|
||||
// write m3u8 to writer.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue