fix freeze when reading a stream with both HLS and RTSP

This commit is contained in:
aler9
2022-12-18 23:16:20 +01:00
parent f9bf62ef0a
commit 0772db509a
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -222,7 +222,9 @@ func (t *formatProcessorH264) process(dat data, hasNonRTSPReaders bool) error {
t.decoder = t.format.CreateDecoder()
}
tdata.rtpPackets = nil
if t.encoder != nil {
tdata.rtpPackets = nil
}
// DecodeUntilMarker() is necessary, otherwise Encode() generates partial groups
nalus, pts, err := t.decoder.DecodeUntilMarker(pkt)
+3 -1
View File
@@ -170,7 +170,9 @@ func (t *formatProcessorH265) process(dat data, hasNonRTSPReaders bool) error {
t.decoder = t.format.CreateDecoder()
}
tdata.rtpPackets = nil
if t.encoder != nil {
tdata.rtpPackets = nil
}
// DecodeUntilMarker() is necessary, otherwise Encode() generates partial groups
nalus, pts, err := t.decoder.DecodeUntilMarker(pkt)