summaryrefslogtreecommitdiffstats
path: root/mpvcore/player/video.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-23 21:39:07 +0100
committerwm4 <wm4@nowhere>2013-11-23 21:39:07 +0100
commit4c2fb8f3a2dbe4d9411007f169326d646943d216 (patch)
treeb623eeadcbb32ca7c8f7ba64e7d18d39dd9723b3 /mpvcore/player/video.c
parent02f96efc509021d3dccea635044580199ddd0665 (diff)
downloadmpv-4c2fb8f3a2dbe4d9411007f169326d646943d216.tar.bz2
mpv-4c2fb8f3a2dbe4d9411007f169326d646943d216.tar.xz
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.
Diffstat (limited to 'mpvcore/player/video.c')
-rw-r--r--mpvcore/player/video.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/mpvcore/player/video.c b/mpvcore/player/video.c
index dea00585c4..0c0199dd7d 100644
--- a/mpvcore/player/video.c
+++ b/mpvcore/player/video.c
@@ -131,10 +131,7 @@ int reinit_video_chain(struct MPContext *mpctx)
d_video->header = sh;
mpctx->initialized_flags |= INITIALIZED_VCODEC;
- // dynamic allocation only to make stheader.h lighter
- talloc_free(d_video->hwdec_info);
- d_video->hwdec_info = talloc_zero(d_video, struct mp_hwdec_info);
- vo_control(mpctx->video_out, VOCTRL_GET_HWDEC_INFO, d_video->hwdec_info);
+ vo_control(mpctx->video_out, VOCTRL_GET_HWDEC_INFO, &d_video->hwdec_info);
if (stream_control(sh->demuxer->stream, STREAM_CTRL_GET_ASPECT_RATIO, &ar)
!= STREAM_UNSUPPORTED)
@@ -236,7 +233,7 @@ static void filter_video(struct MPContext *mpctx, struct mp_image *frame)
init_filter_params(mpctx);
frame->pts = d_video->pts;
- mp_image_set_params(frame, d_video->vf_input);
+ mp_image_set_params(frame, &d_video->vf_input); // force csp/aspect overrides
vf_filter_frame(d_video->vfilter, frame);
filter_output_queued_frame(mpctx);
}