mirror of https://github.com/mpv-player/mpv
video: let sh_video->disp_w/h always be container size
Nothing really accesses it. Subtitle initialization actually does in a somewhat meaningful way, but there container size is probably fine, as subtitles were always initialized before the first video frame was decoded.
This commit is contained in:
parent
9a55c4e70c
commit
5a837ced0b
|
@ -1429,18 +1429,22 @@ static int mp_property_video_bitrate(m_option_t *prop, int action,
|
|||
static int mp_property_width(m_option_t *prop, int action, void *arg,
|
||||
MPContext *mpctx)
|
||||
{
|
||||
if (!mpctx->sh_video)
|
||||
struct sh_video *sh = mpctx->sh_video;
|
||||
if (!sh)
|
||||
return M_PROPERTY_UNAVAILABLE;
|
||||
return m_property_int_ro(prop, action, arg, mpctx->sh_video->disp_w);
|
||||
return m_property_int_ro(prop, action, arg,
|
||||
sh->vf_input ? sh->vf_input->w : sh->disp_w);
|
||||
}
|
||||
|
||||
/// Video display height (RO)
|
||||
static int mp_property_height(m_option_t *prop, int action, void *arg,
|
||||
MPContext *mpctx)
|
||||
{
|
||||
if (!mpctx->sh_video)
|
||||
struct sh_video *sh = mpctx->sh_video;
|
||||
if (!sh)
|
||||
return M_PROPERTY_UNAVAILABLE;
|
||||
return m_property_int_ro(prop, action, arg, mpctx->sh_video->disp_h);
|
||||
return m_property_int_ro(prop, action, arg,
|
||||
sh->vf_input ? sh->vf_input->h : sh->disp_h);
|
||||
}
|
||||
|
||||
static int property_vo_wh(m_option_t *prop, int action, void *arg,
|
||||
|
|
|
@ -58,12 +58,9 @@ int mpcodecs_reconfig_vo(sh_video_t *sh, const struct mp_image_params *params)
|
|||
|
||||
sh->vf_reconfig_count++;
|
||||
|
||||
sh->disp_w = p.w;
|
||||
sh->disp_h = p.h;
|
||||
|
||||
mp_msg(MSGT_DECVIDEO, MSGL_V,
|
||||
"VIDEO: %dx%d %5.3f fps %5.1f kbps (%4.1f kB/s)\n",
|
||||
sh->disp_w, sh->disp_h, sh->fps, sh->i_bps * 0.008,
|
||||
p.w, p.h, sh->fps, sh->i_bps * 0.008,
|
||||
sh->i_bps / 1000.0);
|
||||
|
||||
mp_msg(MSGT_DECVIDEO, MSGL_V, "VDec: vo config request - %d x %d (%s)\n",
|
||||
|
|
Loading…
Reference in New Issue