mirror of
https://github.com/bluenviron/mediamtx.git
synced 2025-12-25 20:41:59 -08:00
hls: fix computation of endPTS
This commit is contained in:
parent
87f24f1704
commit
9bbb188392
1 changed files with 10 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue