summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-01-29 22:47:27 +0100
committerwm4 <wm4@nowhere>2016-01-29 22:47:27 +0100
commita8dd0abb6d72e271384b2dde3026bb545a12b730 (patch)
treec599c25af3fed63cd48697aa93bc4b4d5fc720b4 /player
parent942a6729fa92c1b4ac4ab7b3feeb19eb3c17e7e9 (diff)
downloadmpv-a8dd0abb6d72e271384b2dde3026bb545a12b730.tar.bz2
mpv-a8dd0abb6d72e271384b2dde3026bb545a12b730.tar.xz
vd_lavc: allow switching between hw/sw decoding any time
We just need to provide an entrypoint for it, and move the main init code to a separate function. This gets rid of the messy video chain full reinit in command.c, which completely destroyed and recreated the video state for the purpose of mid-stream hw/sw switching.
Diffstat (limited to 'player')
-rw-r--r--player/command.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/player/command.c b/player/command.c
index 848905da32..fd793c87c9 100644
--- a/player/command.c
+++ b/player/command.c
@@ -2131,9 +2131,8 @@ static int mp_property_hwdec(void *ctx, struct m_property *prop,
int current = -2;
video_vd_control(vd, VDCTRL_GET_HWDEC, &current);
if (current != opts->hwdec_api) {
+ video_vd_control(vd, VDCTRL_REINIT, NULL);
double last_pts = mpctx->last_vo_pts;
- uninit_video_chain(mpctx);
- reinit_video_chain(mpctx);
if (last_pts != MP_NOPTS_VALUE)
queue_seek(mpctx, MPSEEK_ABSOLUTE, last_pts, MPSEEK_EXACT, true);
}