diff options
author | wm4 <wm4@nowhere> | 2016-01-21 22:33:28 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-01-22 00:25:44 +0100 |
commit | 536efe6faf30964b77e0dd724e1c824e351008e7 (patch) | |
tree | 8c9a4a54ed8be5b43e3855d6cb365bc265089459 /player | |
parent | 7bb9203f7fec1ad4e40a7ae58d68b604c0a4565e (diff) |
player: fix some oversights in video refactoring
vo_chain_uninit() isn't supposed to care much about the decoder
(although decoders and outputs still go strictly together, so there is
not much of an actual difference now).
Also unset track.d_video correctly.
Remove a stale declaration from dec_video.h as well.
Diffstat (limited to 'player')
-rw-r--r-- | player/video.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/player/video.c b/player/video.c index 8b766eac47..21629b8990 100644 --- a/player/video.c +++ b/player/video.c @@ -280,11 +280,7 @@ void uninit_video_out(struct MPContext *mpctx) static void vo_chain_uninit(struct vo_chain *vo_c) { mp_image_unrefp(&vo_c->input_mpi); - if (vo_c) { - vf_destroy(vo_c->vf); - if (vo_c->video_src) - video_uninit(vo_c->video_src); - } + vf_destroy(vo_c->vf); talloc_free(vo_c); // this does not free the VO } @@ -292,7 +288,16 @@ static void vo_chain_uninit(struct vo_chain *vo_c) void uninit_video_chain(struct MPContext *mpctx) { if (mpctx->vo_chain) { + struct track *track = mpctx->current_track[0][STREAM_VIDEO]; + assert(track); + assert(track->d_video == mpctx->vo_chain->video_src); + reset_video_state(mpctx); + + video_uninit(track->d_video); + track->d_video = NULL; + mpctx->vo_chain->video_src = NULL; + vo_chain_uninit(mpctx->vo_chain); mpctx->vo_chain = NULL; mpctx->video_status = STATUS_EOF; |