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

Refactor HttpResponseWriter.write, default to single text mode.

This commit is contained in:
winlin 2019-12-17 15:14:59 +08:00
parent 8cdb7cc727
commit d9842b0371
6 changed files with 96 additions and 24 deletions

View file

@ -117,6 +117,7 @@ srs_error_t SrsVodStream::serve_flv_stream(ISrsHttpResponseWriter* w, ISrsHttpMe
// write http header for ts.
w->header()->set_content_length((int)(sizeof(flv_header) + sh_size + left));
w->header()->set_content_type("video/x-flv");
w->write_header(SRS_CONSTS_HTTP_OK);
// write flv header and sequence header.
if ((err = w->write(flv_header, sizeof(flv_header))) != srs_success) {
@ -170,8 +171,6 @@ srs_error_t SrsVodStream::serve_mp4_stream(ISrsHttpResponseWriter* w, ISrsHttpMe
// write http header for ts.
w->header()->set_content_length(left);
w->header()->set_content_type("video/mp4");
// status code 206 to make dash.as happy.
w->write_header(SRS_CONSTS_HTTP_PartialContent);
// response the content range header.