mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
for #340, #343, add wiki and use srs string function, support hls_entry_prefix(hls base url). 2.0.142
This commit is contained in:
parent
1a12ff0d94
commit
2241ba0e34
5 changed files with 12 additions and 20 deletions
|
@ -532,7 +532,7 @@ vhost with-hls.srs.com {
|
||||||
# http://your-server/live/livestream-1.ts
|
# http://your-server/live/livestream-1.ts
|
||||||
# ...
|
# ...
|
||||||
# optional, default to empty string.
|
# optional, default to empty string.
|
||||||
hls_entry_prefix http://your-server/;
|
hls_entry_prefix http://your-server;
|
||||||
# the hls mount for hls_storage ram,
|
# the hls mount for hls_storage ram,
|
||||||
# which use srs embeded http server to delivery HLS,
|
# which use srs embeded http server to delivery HLS,
|
||||||
# where the mount specifies the HTTP url to mount.
|
# where the mount specifies the HTTP url to mount.
|
||||||
|
|
|
@ -3152,17 +3152,7 @@ string SrsConfig::get_hls_entry_prefix(string vhost)
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string prefix = conf->arg0();
|
return conf->arg0();
|
||||||
if (prefix.empty()) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
const char last = prefix[prefix.length() - 1];
|
|
||||||
if (last != '/') {
|
|
||||||
return prefix.append("/");
|
|
||||||
}
|
|
||||||
|
|
||||||
return prefix;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
string SrsConfig::get_hls_path(string vhost)
|
string SrsConfig::get_hls_path(string vhost)
|
||||||
|
|
|
@ -203,14 +203,14 @@ int SrsHlsMuxer::sequence_no()
|
||||||
return _sequence_no;
|
return _sequence_no;
|
||||||
}
|
}
|
||||||
|
|
||||||
int SrsHlsMuxer::update_config(SrsRequest* r, string hls_entry_prefix, string path, int fragment, int window)
|
int SrsHlsMuxer::update_config(SrsRequest* r, string entry_prefix, string path, int fragment, int window)
|
||||||
{
|
{
|
||||||
int ret = ERROR_SUCCESS;
|
int ret = ERROR_SUCCESS;
|
||||||
|
|
||||||
srs_freep(req);
|
srs_freep(req);
|
||||||
req = r->copy();
|
req = r->copy();
|
||||||
|
|
||||||
entry_prefix = hls_entry_prefix;
|
hls_entry_prefix = entry_prefix;
|
||||||
hls_path = path;
|
hls_path = path;
|
||||||
hls_fragment = fragment;
|
hls_fragment = fragment;
|
||||||
hls_window = window;
|
hls_window = window;
|
||||||
|
@ -301,8 +301,10 @@ int SrsHlsMuxer::segment_open(int64_t segment_start_dts)
|
||||||
current->full_path += "/";
|
current->full_path += "/";
|
||||||
current->full_path += filename;
|
current->full_path += filename;
|
||||||
|
|
||||||
// TODO: support base url, and so on.
|
current->uri += hls_entry_prefix;
|
||||||
current->uri += entry_prefix;
|
if (!hls_entry_prefix.empty() && !srs_string_ends_with(hls_entry_prefix, "/")) {
|
||||||
|
current->uri += "/";
|
||||||
|
}
|
||||||
current->uri += filename;
|
current->uri += filename;
|
||||||
|
|
||||||
std::string tmp_file = current->full_path + ".tmp";
|
std::string tmp_file = current->full_path + ".tmp";
|
||||||
|
|
|
@ -167,7 +167,7 @@ class SrsHlsMuxer
|
||||||
private:
|
private:
|
||||||
SrsRequest* req;
|
SrsRequest* req;
|
||||||
private:
|
private:
|
||||||
std::string entry_prefix;
|
std::string hls_entry_prefix;
|
||||||
std::string hls_path;
|
std::string hls_path;
|
||||||
int hls_fragment;
|
int hls_fragment;
|
||||||
int hls_window;
|
int hls_window;
|
||||||
|
@ -208,7 +208,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* when publish, update the config for muxer.
|
* when publish, update the config for muxer.
|
||||||
*/
|
*/
|
||||||
virtual int update_config(SrsRequest* r, std::string hls_entry_prefix, std::string path, int fragment, int window);
|
virtual int update_config(SrsRequest* r, std::string entry_prefix, std::string path, int fragment, int window);
|
||||||
/**
|
/**
|
||||||
* open a new segment(a new ts file),
|
* open a new segment(a new ts file),
|
||||||
* @param segment_start_dts use to calc the segment duration,
|
* @param segment_start_dts use to calc the segment duration,
|
||||||
|
|
|
@ -29,9 +29,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// current release version
|
// current release version
|
||||||
#define VERSION_MAJOR 3
|
#define VERSION_MAJOR 2
|
||||||
#define VERSION_MINOR 0
|
#define VERSION_MINOR 0
|
||||||
#define VERSION_REVISION 0
|
#define VERSION_REVISION 142
|
||||||
|
|
||||||
// server info.
|
// server info.
|
||||||
#define RTMP_SIG_SRS_KEY "SRS"
|
#define RTMP_SIG_SRS_KEY "SRS"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue