Skip to content

Commit

Permalink
fix bug:宽高计算错误,导致quicktime 播放花屏
Browse files Browse the repository at this point in the history
  • Loading branch information
yapingcat committed Jun 20, 2022
1 parent 5a55442 commit 68841d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion codec/h264.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func GetH264Resolution(sps []byte) (width uint32, height uint32) {
s.Decode(bs)

widthInSample := (uint32(s.Pic_width_in_mbs_minus1) + 1) * 16
widthCrop := uint32(s.Frame_crop_left_offset)*2 - uint32(s.Frame_crop_right_offset)*2
widthCrop := uint32(s.Frame_crop_left_offset)*2 + uint32(s.Frame_crop_right_offset)*2
width = widthInSample - widthCrop

heightInSample := ((2 - uint32(s.Frame_mbs_only_flag)) * (uint32(s.Pic_height_in_map_units_minus1) + 1) * 16)
Expand Down

0 comments on commit 68841d1

Please sign in to comment.