Browse Source

hls: fix computation of endPTS

pull/858/head
aler9 4 years ago
parent
commit
9bbb188392
  1. 12
      internal/hls/muxer_ts_segment.go

12
internal/hls/muxer_ts_segment.go

@ -119,7 +119,11 @@ func (t *muxerTSSegment) writeH264( @@ -119,7 +119,11 @@ func (t *muxerTSSegment) writeH264(
if t.startPTS == nil {
t.startPTS = &pts
}
t.endPTS = pts // save endPTS in case next write fails
if pts > t.endPTS {
t.endPTS = pts
}
return nil
}
@ -168,6 +172,10 @@ func (t *muxerTSSegment) writeAAC( @@ -168,6 +172,10 @@ func (t *muxerTSSegment) writeAAC(
if t.startPTS == nil {
t.startPTS = &pts
}
t.endPTS = pts // save endPTS in case next write fails
if pts > t.endPTS {
t.endPTS = pts
}
return nil
}

Loading…
Cancel
Save