winlin

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

... ... @@ -385,6 +385,7 @@ Supported operating systems and hardware:
## 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
* <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>
* 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
... ...
... ... @@ -655,10 +655,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, SrsBuffer* ab)
{
int ret = ERROR_SUCCESS;
... ... @@ -1090,7 +1095,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, af->pts)) != ERROR_SUCCESS) {
return ret;
}
... ...
... ... @@ -192,10 +192,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, SrsBuffer* ab);
virtual int flush_video(SrsMpegtsFrame* af, SrsBuffer* ab, SrsMpegtsFrame* vf, SrsBuffer* vb);
/**
... ...
... ... @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR 1
#define VERSION_MINOR 0
#define VERSION_REVISION 22
#define VERSION_REVISION 23
// server info.
#define RTMP_SIG_SRS_KEY "SRS"
#define RTMP_SIG_SRS_ROLE "origin/edge server"
... ...