From 68efca4fa995f677916c510013669444cb5c1778 Mon Sep 17 00:00:00 2001 From: winlin Date: Tue, 4 Feb 2020 16:39:01 +0800 Subject: [PATCH] For #939, always enable fast FLV streaming. --- trunk/src/app/srs_app_http_stream.cpp | 22 ++++------------------ trunk/src/app/srs_app_http_stream.hpp | 9 --------- 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/trunk/src/app/srs_app_http_stream.cpp b/trunk/src/app/srs_app_http_stream.cpp index 4bb38e5f9..e8253a94f 100755 --- a/trunk/src/app/srs_app_http_stream.cpp +++ b/trunk/src/app/srs_app_http_stream.cpp @@ -300,15 +300,7 @@ srs_error_t SrsFlvStreamEncoder::dump_cache(SrsConsumer* /*consumer*/, SrsRtmpJi return srs_success; } -SrsFastFlvStreamEncoder::SrsFastFlvStreamEncoder() -{ -} - -SrsFastFlvStreamEncoder::~SrsFastFlvStreamEncoder() -{ -} - -srs_error_t SrsFastFlvStreamEncoder::write_tags(SrsSharedPtrMessage** msgs, int count) +srs_error_t SrsFlvStreamEncoder::write_tags(SrsSharedPtrMessage** msgs, int count) { return enc->write_tags(msgs, count); } @@ -509,14 +501,8 @@ srs_error_t SrsLiveStream::do_serve_http(ISrsHttpResponseWriter* w, ISrsHttpMess srs_assert(entry); if (srs_string_ends_with(entry->pattern, ".flv")) { w->header()->set_content_type("video/x-flv"); - bool realtime = _srs_config->get_realtime_enabled(req->vhost); - if (realtime) { - enc_desc = "FLV"; - enc = new SrsFlvStreamEncoder(); - } else { - enc_desc = "FastFLV"; - enc = new SrsFastFlvStreamEncoder(); - } + enc_desc = "FLV"; + enc = new SrsFlvStreamEncoder(); } else if (srs_string_ends_with(entry->pattern, ".aac")) { w->header()->set_content_type("audio/x-aac"); enc_desc = "AAC"; @@ -569,7 +555,7 @@ srs_error_t SrsLiveStream::do_serve_http(ISrsHttpResponseWriter* w, ISrsHttpMess } } - SrsFastFlvStreamEncoder* ffe = dynamic_cast(enc); + SrsFlvStreamEncoder* ffe = dynamic_cast(enc); // Use receive thread to accept the close event to avoid FD leak. // @see https://github.com/ossrs/srs/issues/636#issuecomment-298208427 diff --git a/trunk/src/app/srs_app_http_stream.hpp b/trunk/src/app/srs_app_http_stream.hpp index 18f7a1b6c..c9a6f7904 100755 --- a/trunk/src/app/srs_app_http_stream.hpp +++ b/trunk/src/app/srs_app_http_stream.hpp @@ -95,15 +95,6 @@ public: public: virtual bool has_cache(); virtual srs_error_t dump_cache(SrsConsumer* consumer, SrsRtmpJitterAlgorithm jitter); -}; - -// A Fast HTTP FLV Live Streaming, to write multiple tags by writev. -// @see https://github.com/ossrs/srs/issues/405 -class SrsFastFlvStreamEncoder : public SrsFlvStreamEncoder -{ -public: - SrsFastFlvStreamEncoder(); - virtual ~SrsFastFlvStreamEncoder(); public: // Write the tags in a time. virtual srs_error_t write_tags(SrsSharedPtrMessage** msgs, int count);