summaryrefslogtreecommitdiffstats
path: root/mpvcore/player/sub.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-23 21:36:20 +0100
committerwm4 <wm4@nowhere>2013-11-23 21:36:20 +0100
commit3486302514db31b8086f46226d9b46d53810d1e7 (patch)
treea5b35e0a67d4cee1b5ec8bb0d489f38495d66b3c /mpvcore/player/sub.c
parent057af4697cf65709012f41ff2f0d97b918c51d79 (diff)
downloadmpv-3486302514db31b8086f46226d9b46d53810d1e7.tar.bz2
mpv-3486302514db31b8086f46226d9b46d53810d1e7.tar.xz
video: move decoder context from sh_video into new struct
This is similar to the sh_audio commit. This is mostly cosmetic in nature, except that it also adds automatical freeing of the decoder driver's state struct (which was in sh_video->context, now in dec_video->priv). Also remove all the stheader.h fields that are not needed anymore.
Diffstat (limited to 'mpvcore/player/sub.c')
-rw-r--r--mpvcore/player/sub.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/mpvcore/player/sub.c b/mpvcore/player/sub.c
index 94368435d1..d659e74851 100644
--- a/mpvcore/player/sub.c
+++ b/mpvcore/player/sub.c
@@ -33,6 +33,7 @@
#include "sub/dec_sub.h"
#include "demux/demux.h"
#include "video/mp_image.h"
+#include "video/decode/dec_video.h"
#include "mp_core.h"
@@ -83,8 +84,8 @@ void update_subtitles(struct MPContext *mpctx)
assert(track && sh_sub);
struct dec_sub *dec_sub = sh_sub->dec_sub;
- if (mpctx->sh_video && mpctx->sh_video->vf_input) {
- struct mp_image_params params = *mpctx->sh_video->vf_input;
+ 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, &params);
}
@@ -194,9 +195,11 @@ void reinit_subs(struct MPContext *mpctx)
assert(dec_sub);
if (!sub_is_initialized(dec_sub)) {
- int w = mpctx->sh_video ? mpctx->sh_video->disp_w : 0;
- int h = mpctx->sh_video ? mpctx->sh_video->disp_h : 0;
- float fps = mpctx->sh_video ? mpctx->sh_video->fps : 25;
+ struct sh_video *sh_video =
+ mpctx->d_video ? mpctx->d_video->header->video : NULL;
+ int w = sh_video ? sh_video->disp_w : 0;
+ int h = sh_video ? sh_video->disp_h : 0;
+ float fps = sh_video ? sh_video->fps : 25;
set_dvdsub_fake_extradata(dec_sub, track->demuxer->stream, w, h);
sub_set_video_res(dec_sub, w, h);