From cd93b706121bc645f6aac5d35740c1b2d9cea3a9 Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Fri, 3 Jun 2022 13:34:11 +0200 Subject: [PATCH] hls muxer: do not use EXT-X-GAP with fmp4 variant --- internal/hls/muxer_variant_fmp4_playlist.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/hls/muxer_variant_fmp4_playlist.go b/internal/hls/muxer_variant_fmp4_playlist.go index fa72edf3..f0ae29f2 100644 --- a/internal/hls/muxer_variant_fmp4_playlist.go +++ b/internal/hls/muxer_variant_fmp4_playlist.go @@ -116,7 +116,10 @@ func (p *muxerVariantFMP4Playlist) close() { } func (p *muxerVariantFMP4Playlist) hasContent() bool { - return len(p.segments) > 0 + if p.lowLatency { + return len(p.segments) >= 1 + } + return len(p.segments) >= 2 } func (p *muxerVariantFMP4Playlist) hasPart(segmentID uint64, partID uint64) bool { @@ -438,7 +441,7 @@ func (p *muxerVariantFMP4Playlist) onSegmentFinalized(segment *muxerVariantFMP4S defer p.mutex.Unlock() // create initial gap - if len(p.segments) == 0 { + if p.lowLatency && len(p.segments) == 0 { for i := 0; i < p.segmentCount; i++ { p.segments = append(p.segments, &muxerVariantFMP4Gap{ renderedDuration: segment.renderedDuration,