diff --git a/README.md b/README.md index d943bb9df..0a54d2689 100755 --- a/README.md +++ b/README.md @@ -521,6 +521,7 @@ Supported operating systems and hardware: ### SRS 2.0 history +* v2.0, 2015-01-23, hotfix [#151](https://github.com/winlinvip/simple-rtmp-server/issues/151), use absolutely overflow to make jwplayer happy. 2.0.103 * v2.0, 2015-01-22, for [#293](https://github.com/winlinvip/simple-rtmp-server/issues/293), support http live ts stream. 2.0.101. * v2.0, 2015-01-19, for [#293](https://github.com/winlinvip/simple-rtmp-server/issues/293), support http live flv/aac/mp3 stream with fast cache. 2.0.100. * v2.0, 2015-01-18, for [#293](https://github.com/winlinvip/simple-rtmp-server/issues/293), support rtmp remux to http flv live stream. 2.0.99. @@ -583,6 +584,7 @@ Supported operating systems and hardware: ### SRS 1.0 history +* v1.0, 2015-01-23, hotfix [#151](https://github.com/winlinvip/simple-rtmp-server/issues/151), use absolutely overflow to make jwplayer happy. 1.0.23 * v1.0, 2015-01-17, hotfix [#290](https://github.com/winlinvip/simple-rtmp-server/issues/290), use iformat only for rtmp input. 1.0.22 * v1.0, 2015-01-15, [1.0r1 release(1.0.21)](https://github.com/winlinvip/simple-rtmp-server/releases/tag/1.0r1) released. 59472 lines. * v1.0, 2015-01-08, hotfix [#281](https://github.com/winlinvip/simple-rtmp-server/issues/281), fix hls bug ignore type-9 send aud. 1.0.20 diff --git a/trunk/src/app/srs_app_hls.cpp b/trunk/src/app/srs_app_hls.cpp index 20dcc4e3a..ef7915a93 100644 --- a/trunk/src/app/srs_app_hls.cpp +++ b/trunk/src/app/srs_app_hls.cpp @@ -189,10 +189,15 @@ int SrsHlsMuxer::on_sequence_header() bool SrsHlsMuxer::is_segment_overflow() { srs_assert(current); - return current->duration >= hls_fragment; } +bool SrsHlsMuxer::is_segment_absolutely_overflow() +{ + srs_assert(current); + return current->duration >= 2 * hls_fragment; +} + int SrsHlsMuxer::flush_audio(SrsMpegtsFrame* af, SrsSimpleBuffer* ab) { int ret = ERROR_SUCCESS; @@ -597,7 +602,9 @@ int SrsHlsCache::write_audio(SrsAvcAacCodec* codec, SrsHlsMuxer* muxer, int64_t // pure audio again for audio disabled. // so we reap event when the audio incoming when segment overflow. // @see https://github.com/winlinvip/simple-rtmp-server/issues/151 - if (muxer->is_segment_overflow()) { + // we use absolutely overflow of segment to make jwplayer/ffplay happy + // @see https://github.com/winlinvip/simple-rtmp-server/issues/151#issuecomment-71155184 + if (muxer->is_segment_absolutely_overflow()) { if ((ret = reap_segment("audio", muxer, cache->af->pts)) != ERROR_SUCCESS) { return ret; } diff --git a/trunk/src/app/srs_app_hls.hpp b/trunk/src/app/srs_app_hls.hpp index f7a03b07f..3fbef0f33 100644 --- a/trunk/src/app/srs_app_hls.hpp +++ b/trunk/src/app/srs_app_hls.hpp @@ -131,10 +131,16 @@ public: virtual int segment_open(int64_t segment_start_dts); virtual int on_sequence_header(); /** - * whether video overflow, - * that is whether the current segment duration >= the segment in config + * whether segment overflow, + * that is whether the current segment duration>=(the segment in config) */ virtual bool is_segment_overflow(); + /** + * whether segment absolutely overflow, for pure audio to reap segment, + * that is whether the current segment duration>=2*(the segment in config) + * @see https://github.com/winlinvip/simple-rtmp-server/issues/151#issuecomment-71155184 + */ + virtual bool is_segment_absolutely_overflow(); virtual int flush_audio(SrsMpegtsFrame* af, SrsSimpleBuffer* ab); virtual int flush_video(SrsMpegtsFrame* af, SrsSimpleBuffer* ab, SrsMpegtsFrame* vf, SrsSimpleBuffer* vb); /**