hls: fix computation of endPTS

This commit is contained in:
aler9 2022-02-21 16:56:07 +01:00
parent 87f24f1704
commit 9bbb188392

View File

@ -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(
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
}