mirror of
https://github.com/aler9/gortsplib
synced 2025-10-19 05:24:44 +08:00
h264: improve DTS extractor
This improves the DTS extractor in order to work with streams with no timing infos or incorrect timing infos
This commit is contained in:
@@ -565,6 +565,11 @@ func (s *SPS) Unmarshal(buf []byte) error {
|
||||
return err
|
||||
}
|
||||
|
||||
s.DeltaPicOrderAlwaysZeroFlag = false
|
||||
s.OffsetForNonRefPic = 0
|
||||
s.OffsetForTopToBottomField = 0
|
||||
s.OffsetForRefFrames = nil
|
||||
|
||||
case 1:
|
||||
s.Log2MaxPicOrderCntLsbMinus4 = 0
|
||||
|
||||
@@ -598,12 +603,15 @@ func (s *SPS) Unmarshal(buf []byte) error {
|
||||
s.OffsetForRefFrames[i] = v
|
||||
}
|
||||
|
||||
default:
|
||||
case 2:
|
||||
s.Log2MaxPicOrderCntLsbMinus4 = 0
|
||||
s.DeltaPicOrderAlwaysZeroFlag = false
|
||||
s.OffsetForNonRefPic = 0
|
||||
s.OffsetForTopToBottomField = 0
|
||||
s.OffsetForRefFrames = nil
|
||||
|
||||
default:
|
||||
return fmt.Errorf("invalid pic_order_cnt_type: %d", s.PicOrderCntType)
|
||||
}
|
||||
|
||||
s.MaxNumRefFrames, err = bits.ReadGolombUnsigned(buf, &pos)
|
||||
|
Reference in New Issue
Block a user