mirror of
https://github.com/bluenviron/mediamtx
synced 2024-12-17 04:04:41 +00:00
hls: fix computation of endPTS
This commit is contained in:
parent
87f24f1704
commit
9bbb188392
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user