winlin

for #151, use absolutely overflow to make jwplayer happy. 2.0.103

@@ -521,6 +521,7 @@ Supported operating systems and hardware: @@ -521,6 +521,7 @@ Supported operating systems and hardware:
521 521
522 ### SRS 2.0 history 522 ### SRS 2.0 history
523 523
  524 +* 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
524 * v2.0, 2015-01-22, for [#293](https://github.com/winlinvip/simple-rtmp-server/issues/293), support http live ts stream. 2.0.101. 525 * v2.0, 2015-01-22, for [#293](https://github.com/winlinvip/simple-rtmp-server/issues/293), support http live ts stream. 2.0.101.
525 * 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. 526 * 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.
526 * 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. 527 * 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: @@ -583,6 +584,7 @@ Supported operating systems and hardware:
583 584
584 ### SRS 1.0 history 585 ### SRS 1.0 history
585 586
  587 +* 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
586 * 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 588 * 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
587 * <strong>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.</strong> 589 * <strong>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.</strong>
588 * 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 590 * 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
@@ -189,10 +189,15 @@ int SrsHlsMuxer::on_sequence_header() @@ -189,10 +189,15 @@ int SrsHlsMuxer::on_sequence_header()
189 bool SrsHlsMuxer::is_segment_overflow() 189 bool SrsHlsMuxer::is_segment_overflow()
190 { 190 {
191 srs_assert(current); 191 srs_assert(current);
192 -  
193 return current->duration >= hls_fragment; 192 return current->duration >= hls_fragment;
194 } 193 }
195 194
  195 +bool SrsHlsMuxer::is_segment_absolutely_overflow()
  196 +{
  197 + srs_assert(current);
  198 + return current->duration >= 2 * hls_fragment;
  199 +}
  200 +
196 int SrsHlsMuxer::flush_audio(SrsMpegtsFrame* af, SrsSimpleBuffer* ab) 201 int SrsHlsMuxer::flush_audio(SrsMpegtsFrame* af, SrsSimpleBuffer* ab)
197 { 202 {
198 int ret = ERROR_SUCCESS; 203 int ret = ERROR_SUCCESS;
@@ -597,7 +602,9 @@ int SrsHlsCache::write_audio(SrsAvcAacCodec* codec, SrsHlsMuxer* muxer, int64_t @@ -597,7 +602,9 @@ int SrsHlsCache::write_audio(SrsAvcAacCodec* codec, SrsHlsMuxer* muxer, int64_t
597 // pure audio again for audio disabled. 602 // pure audio again for audio disabled.
598 // so we reap event when the audio incoming when segment overflow. 603 // so we reap event when the audio incoming when segment overflow.
599 // @see https://github.com/winlinvip/simple-rtmp-server/issues/151 604 // @see https://github.com/winlinvip/simple-rtmp-server/issues/151
600 - if (muxer->is_segment_overflow()) { 605 + // we use absolutely overflow of segment to make jwplayer/ffplay happy
  606 + // @see https://github.com/winlinvip/simple-rtmp-server/issues/151#issuecomment-71155184
  607 + if (muxer->is_segment_absolutely_overflow()) {
601 if ((ret = reap_segment("audio", muxer, cache->af->pts)) != ERROR_SUCCESS) { 608 if ((ret = reap_segment("audio", muxer, cache->af->pts)) != ERROR_SUCCESS) {
602 return ret; 609 return ret;
603 } 610 }
@@ -131,10 +131,16 @@ public: @@ -131,10 +131,16 @@ public:
131 virtual int segment_open(int64_t segment_start_dts); 131 virtual int segment_open(int64_t segment_start_dts);
132 virtual int on_sequence_header(); 132 virtual int on_sequence_header();
133 /** 133 /**
134 - * whether video overflow,  
135 - * that is whether the current segment duration >= the segment in config 134 + * whether segment overflow,
  135 + * that is whether the current segment duration>=(the segment in config)
136 */ 136 */
137 virtual bool is_segment_overflow(); 137 virtual bool is_segment_overflow();
  138 + /**
  139 + * whether segment absolutely overflow, for pure audio to reap segment,
  140 + * that is whether the current segment duration>=2*(the segment in config)
  141 + * @see https://github.com/winlinvip/simple-rtmp-server/issues/151#issuecomment-71155184
  142 + */
  143 + virtual bool is_segment_absolutely_overflow();
138 virtual int flush_audio(SrsMpegtsFrame* af, SrsSimpleBuffer* ab); 144 virtual int flush_audio(SrsMpegtsFrame* af, SrsSimpleBuffer* ab);
139 virtual int flush_video(SrsMpegtsFrame* af, SrsSimpleBuffer* ab, SrsMpegtsFrame* vf, SrsSimpleBuffer* vb); 145 virtual int flush_video(SrsMpegtsFrame* af, SrsSimpleBuffer* ab, SrsMpegtsFrame* vf, SrsSimpleBuffer* vb);
140 /** 146 /**