winlin

add pdf of hls rfc, corrent the content type.

@@ -564,7 +564,7 @@ int SrsHlsMuxer::_refresh_m3u8(string m3u8_file) @@ -564,7 +564,7 @@ int SrsHlsMuxer::_refresh_m3u8(string m3u8_file)
564 564
565 // "#EXTINF:4294967295.208,\n" 565 // "#EXTINF:4294967295.208,\n"
566 char ext_info[25]; // 14+10+1 566 char ext_info[25]; // 14+10+1
567 - len = snprintf(ext_info, sizeof(ext_info), "#EXTINF:%.3f\n", segment->duration); 567 + len = snprintf(ext_info, sizeof(ext_info), "#EXTINF:%.3f,\n", segment->duration);
568 if ((ret = writer.write(ext_info, len, NULL)) != ERROR_SUCCESS) { 568 if ((ret = writer.write(ext_info, len, NULL)) != ERROR_SUCCESS) {
569 srs_error("write m3u8 segment info failed. ret=%d", ret); 569 srs_error("write m3u8 segment info failed. ret=%d", ret);
570 return ret; 570 return ret;
@@ -56,7 +56,7 @@ using namespace std; @@ -56,7 +56,7 @@ using namespace std;
56 int srs_go_http_response_json(ISrsGoHttpResponseWriter* w, string data) 56 int srs_go_http_response_json(ISrsGoHttpResponseWriter* w, string data)
57 { 57 {
58 w->header()->set_content_length(data.length()); 58 w->header()->set_content_length(data.length());
59 - w->header()->set_content_type("application/json;charset=utf-8"); 59 + w->header()->set_content_type("application/json");
60 60
61 return w->write((char*)data.data(), data.length()); 61 return w->write((char*)data.data(), data.length());
62 } 62 }
@@ -344,17 +344,18 @@ int SrsGoHttpFileServer::serve_file(ISrsGoHttpResponseWriter* w, SrsHttpMessage* @@ -344,17 +344,18 @@ int SrsGoHttpFileServer::serve_file(ISrsGoHttpResponseWriter* w, SrsHttpMessage*
344 _mime[".mp3"] = "audio/mpeg"; 344 _mime[".mp3"] = "audio/mpeg";
345 _mime[".m4a"] = "audio/x-m4a"; 345 _mime[".m4a"] = "audio/x-m4a";
346 _mime[".ogg"] = "audio/ogg"; 346 _mime[".ogg"] = "audio/ogg";
347 - _mime[".m3u8"] = "application/x-mpegURL;charset=utf-8"; 347 + // @see hls-m3u8-draft-pantos-http-live-streaming-12.pdf, page 5.
  348 + _mime[".m3u8"] = "application/vnd.apple.mpegurl"; // application/x-mpegURL
348 _mime[".rss"] = "application/rss+xml"; 349 _mime[".rss"] = "application/rss+xml";
349 - _mime[".json"] = "application/json;charset=utf-8"; 350 + _mime[".json"] = "application/json";
350 _mime[".swf"] = "application/x-shockwave-flash"; 351 _mime[".swf"] = "application/x-shockwave-flash";
351 _mime[".doc"] = "application/msword"; 352 _mime[".doc"] = "application/msword";
352 _mime[".zip"] = "application/zip"; 353 _mime[".zip"] = "application/zip";
353 _mime[".rar"] = "application/x-rar-compressed"; 354 _mime[".rar"] = "application/x-rar-compressed";
354 - _mime[".xml"] = "text/xml;charset=utf-8";  
355 - _mime[".html"] = "text/html;charset=utf-8"; 355 + _mime[".xml"] = "text/xml";
  356 + _mime[".html"] = "text/html";
356 _mime[".js"] = "text/javascript"; 357 _mime[".js"] = "text/javascript";
357 - _mime[".css"] = "text/css;charset=utf-8"; 358 + _mime[".css"] = "text/css";
358 _mime[".ico"] = "image/x-icon"; 359 _mime[".ico"] = "image/x-icon";
359 _mime[".png"] = "image/png"; 360 _mime[".png"] = "image/png";
360 _mime[".jpeg"] = "image/jpeg"; 361 _mime[".jpeg"] = "image/jpeg";