for #151, use absolutely overflow to make jwplayer happy. 1.0.23
正在显示
4 个修改的文件
包含
19 行增加
和
5 行删除
@@ -385,6 +385,7 @@ Supported operating systems and hardware: | @@ -385,6 +385,7 @@ Supported operating systems and hardware: | ||
385 | 385 | ||
386 | ## History | 386 | ## History |
387 | 387 | ||
388 | +* 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 | ||
388 | * 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 | 389 | * 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 |
389 | * <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> | 390 | * <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> |
390 | * 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 | 391 | * 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() | @@ -655,10 +655,15 @@ int SrsHlsMuxer::on_sequence_header() | ||
655 | bool SrsHlsMuxer::is_segment_overflow() | 655 | bool SrsHlsMuxer::is_segment_overflow() |
656 | { | 656 | { |
657 | srs_assert(current); | 657 | srs_assert(current); |
658 | - | ||
659 | return current->duration >= hls_fragment; | 658 | return current->duration >= hls_fragment; |
660 | } | 659 | } |
661 | 660 | ||
661 | +bool SrsHlsMuxer::is_segment_absolutely_overflow() | ||
662 | +{ | ||
663 | + srs_assert(current); | ||
664 | + return current->duration >= 2 * hls_fragment; | ||
665 | +} | ||
666 | + | ||
662 | int SrsHlsMuxer::flush_audio(SrsMpegtsFrame* af, SrsBuffer* ab) | 667 | int SrsHlsMuxer::flush_audio(SrsMpegtsFrame* af, SrsBuffer* ab) |
663 | { | 668 | { |
664 | int ret = ERROR_SUCCESS; | 669 | int ret = ERROR_SUCCESS; |
@@ -1090,7 +1095,9 @@ int SrsHlsCache::write_audio(SrsAvcAacCodec* codec, SrsHlsMuxer* muxer, int64_t | @@ -1090,7 +1095,9 @@ int SrsHlsCache::write_audio(SrsAvcAacCodec* codec, SrsHlsMuxer* muxer, int64_t | ||
1090 | // pure audio again for audio disabled. | 1095 | // pure audio again for audio disabled. |
1091 | // so we reap event when the audio incoming when segment overflow. | 1096 | // so we reap event when the audio incoming when segment overflow. |
1092 | // @see https://github.com/winlinvip/simple-rtmp-server/issues/151 | 1097 | // @see https://github.com/winlinvip/simple-rtmp-server/issues/151 |
1093 | - if (muxer->is_segment_overflow()) { | 1098 | + // we use absolutely overflow of segment to make jwplayer/ffplay happy |
1099 | + // @see https://github.com/winlinvip/simple-rtmp-server/issues/151#issuecomment-71155184 | ||
1100 | + if (muxer->is_segment_absolutely_overflow()) { | ||
1094 | if ((ret = reap_segment("audio", muxer, af->pts)) != ERROR_SUCCESS) { | 1101 | if ((ret = reap_segment("audio", muxer, af->pts)) != ERROR_SUCCESS) { |
1095 | return ret; | 1102 | return ret; |
1096 | } | 1103 | } |
@@ -192,10 +192,16 @@ public: | @@ -192,10 +192,16 @@ public: | ||
192 | virtual int segment_open(int64_t segment_start_dts); | 192 | virtual int segment_open(int64_t segment_start_dts); |
193 | virtual int on_sequence_header(); | 193 | virtual int on_sequence_header(); |
194 | /** | 194 | /** |
195 | - * whether video overflow, | ||
196 | - * that is whether the current segment duration >= the segment in config | 195 | + * whether segment overflow, |
196 | + * that is whether the current segment duration>=(the segment in config) | ||
197 | */ | 197 | */ |
198 | virtual bool is_segment_overflow(); | 198 | virtual bool is_segment_overflow(); |
199 | + /** | ||
200 | + * whether segment absolutely overflow, for pure audio to reap segment, | ||
201 | + * that is whether the current segment duration>=2*(the segment in config) | ||
202 | + * @see https://github.com/winlinvip/simple-rtmp-server/issues/151#issuecomment-71155184 | ||
203 | + */ | ||
204 | + virtual bool is_segment_absolutely_overflow(); | ||
199 | virtual int flush_audio(SrsMpegtsFrame* af, SrsBuffer* ab); | 205 | virtual int flush_audio(SrsMpegtsFrame* af, SrsBuffer* ab); |
200 | virtual int flush_video(SrsMpegtsFrame* af, SrsBuffer* ab, SrsMpegtsFrame* vf, SrsBuffer* vb); | 206 | virtual int flush_video(SrsMpegtsFrame* af, SrsBuffer* ab, SrsMpegtsFrame* vf, SrsBuffer* vb); |
201 | /** | 207 | /** |
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
31 | // current release version | 31 | // current release version |
32 | #define VERSION_MAJOR 1 | 32 | #define VERSION_MAJOR 1 |
33 | #define VERSION_MINOR 0 | 33 | #define VERSION_MINOR 0 |
34 | -#define VERSION_REVISION 22 | 34 | +#define VERSION_REVISION 23 |
35 | // server info. | 35 | // server info. |
36 | #define RTMP_SIG_SRS_KEY "SRS" | 36 | #define RTMP_SIG_SRS_KEY "SRS" |
37 | #define RTMP_SIG_SRS_ROLE "origin/edge server" | 37 | #define RTMP_SIG_SRS_ROLE "origin/edge server" |
-
请 注册 或 登录 后发表评论