Skip to content

Commit 4ef3f49

Browse files
committed
rtpdec_h264: fixed cropping
If cropping_flag is used, from the size the margin was perhaps incorrectly substracted twice times. Eg. in the example stream from the previous commit the resolution was not 1920x1080 but 1920x1792 - 8 was substracted twice).
1 parent 707422d commit 4ef3f49

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rtp/rtpdec_h264.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,8 @@ width_height_from_h264_sps(int *widthOut, int *heightOut, unsigned char *data,
483483
//NOTE: frame_mbs_only_flag = 1 --> only progressive frames
484484
// frame_mbs_only_flag = 0 --> some type of interlacing (there are 3 types contemplated in the standard)
485485
if (sps->frame_cropping_flag){
486-
width -= (sps->frame_crop_left_offset*2 + sps->frame_crop_right_offset*2);
487-
height -= (sps->frame_crop_top_offset*2 + sps->frame_crop_bottom_offset*2);
486+
width -= (sps->frame_crop_left_offset + sps->frame_crop_right_offset);
487+
height -= (sps->frame_crop_top_offset + sps->frame_crop_bottom_offset);
488488
}
489489

490490
debug_msg("\n\n[width_height_from_SDP] width: %d height: %d\n\n",width,height);

0 commit comments

Comments
 (0)