This reverts commit 81102b0f6c7db956cd222ea3e81debda36de5a78.
Unified · Split
| @@ -1692,20 +1692,23 @@ static int demux_mkv_open_video(demuxer_t *demuxer, mkv_track_t *track) · 1691 unmodified lines | |||
| 1692 | sh_v->disp_w = track->v_width; | 1692 | sh_v->disp_w = track->v_width; |
| 1693 | sh_v->disp_h = track->v_height; | 1693 | sh_v->disp_h = track->v_height; |
| 1694 | 1694 | ||
| 1695 | struct mp_rect crop; | ||
| 1696 | crop.x0 = track->v_crop_left; | ||
| 1697 | crop.y0 = track->v_crop_top; | ||
| 1698 | crop.x1 = track->v_width - track->v_crop_right; | ||
| 1699 | crop.y1 = track->v_height - track->v_crop_bottom; | ||
| 1700 | |||
| 1695 | // Keep the codec crop rect as 0s if we have no cropping since the | 1701 | // Keep the codec crop rect as 0s if we have no cropping since the |
| 1696 | // file may have broken width/height tags. | 1702 | // file may have broken width/height tags. |
| 1697 | if (track->v_crop_left || track->v_crop_top || | 1703 | if (track->v_crop_left || track->v_crop_top || |
| 1698 | track->v_crop_right || track->v_crop_bottom) | 1704 | track->v_crop_right || track->v_crop_bottom) |
| 1699 | { | 1705 | { |
| 1700 | sh_v->crop.x0 = track->v_crop_left; | 1706 | sh_v->crop = crop; |
| 1701 | sh_v->crop.y0 = track->v_crop_top; | ||
| 1702 | sh_v->crop.x1 = track->v_width - track->v_crop_right; | ||
| 1703 | sh_v->crop.y1 = track->v_height - track->v_crop_bottom; | ||
| 1704 | } | 1707 | } |
| 1705 | 1708 | ||
| 1706 | int dw = track->v_dwidth_set ? track->v_dwidth : track->v_width; | 1709 | int dw = track->v_dwidth_set ? track->v_dwidth : mp_rect_w(crop); |
| 1707 | int dh = track->v_dheight_set ? track->v_dheight : track->v_height; | 1710 | int dh = track->v_dheight_set ? track->v_dheight : mp_rect_h(crop); |
| 1708 | struct mp_image_params p = {.w = track->v_width, .h = track->v_height}; | 1711 | struct mp_image_params p = {.w = mp_rect_w(crop), .h = mp_rect_h(crop)}; |
| 1709 | mp_image_params_set_dsize(&p, dw, dh); | 1712 | mp_image_params_set_dsize(&p, dw, dh); |
| 1710 | sh_v->par_w = p.p_w; | 1713 | sh_v->par_w = p.p_w; |
| 1711 | sh_v->par_h = p.p_h; | 1714 | sh_v->par_h = p.p_h; |