From 4c2fb8f3a2dbe4d9411007f169326d646943d216 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 23 Nov 2013 21:39:07 +0100 Subject: dec_video: make vf_input and hwdec_info statically allocated The only reason why these structs were dynamically allocated was to avoid recursive includes in stheader.h, which is (or was) a very central file included by almost all other files. (If a struct is referenced via a pointer type only, it can be forward referenced, and the definition of the struct is not needed.) Now that they're out of stheader.h, this difference doesn't matter anymore, and the code can be simplified. Also sneak in some sanity checks. --- mpvcore/player/sub.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mpvcore/player/sub.c') diff --git a/mpvcore/player/sub.c b/mpvcore/player/sub.c index bdcb9def09..2c6ec1dfc5 100644 --- a/mpvcore/player/sub.c +++ b/mpvcore/player/sub.c @@ -83,9 +83,10 @@ void update_subtitles(struct MPContext *mpctx) struct dec_sub *dec_sub = mpctx->d_sub; assert(track && dec_sub); - if (mpctx->d_video && mpctx->d_video->vf_input) { - struct mp_image_params params = *mpctx->d_video->vf_input; - sub_control(dec_sub, SD_CTRL_SET_VIDEO_PARAMS, ¶ms); + if (mpctx->d_video) { + struct mp_image_params params = mpctx->d_video->vf_input; + if (params.imgfmt) + sub_control(dec_sub, SD_CTRL_SET_VIDEO_PARAMS, ¶ms); } mpctx->osd->video_offset = track->under_timeline ? mpctx->video_offset : 0; -- cgit v1.2.3