summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2011-06-19 16:05:35 +0000
committerUoti Urpala <uau@mplayer2.org>2011-07-06 13:01:07 +0300
commitcb5c492aa7ed470e61a26e6e7f4451363d4ccd76 (patch)
tree1186f0a3673d5086253c2aaf94c2d18fa9632920 /mplayer.c
parent070491f1029ca3d74322146e646d653f9f5dc153 (diff)
downloadmpv-cb5c492aa7ed470e61a26e6e7f4451363d4ccd76.tar.bz2
mpv-cb5c492aa7ed470e61a26e6e7f4451363d4ccd76.tar.xz
cleanup: mplayer.c: Factor out a bit of spudec code
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33662 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/mplayer.c b/mplayer.c
index 80e7a8d20e..a589fd3679 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -1130,6 +1130,7 @@ void add_subtitles(struct MPContext *mpctx, char *filename, float fps, int noerr
void init_vo_spudec(struct MPContext *mpctx)
{
+ unsigned width, height;
spudec_free(vo_spudec);
mpctx->initialized_flags &= ~INITIALIZED_SPUDEC;
vo_spudec = NULL;
@@ -1139,17 +1140,20 @@ void init_vo_spudec(struct MPContext *mpctx)
return;
if (spudec_ifo) {
- unsigned int palette[16], width, height;
+ unsigned int palette[16];
current_module="spudec_init_vobsub";
if (vobsub_parse_ifo(NULL,spudec_ifo, palette, &width, &height, 1, -1, NULL) >= 0)
vo_spudec=spudec_new_scaled(palette, width, height, NULL, 0);
}
+ width = mpctx->sh_video->disp_w;
+ height = mpctx->sh_video->disp_h;
+
#ifdef CONFIG_DVDREAD
if (vo_spudec==NULL && mpctx->stream->type==STREAMTYPE_DVD) {
current_module="spudec_init_dvdread";
vo_spudec=spudec_new_scaled(((dvd_priv_t *)(mpctx->stream->priv))->cur_pgc->palette,
- mpctx->sh_video->disp_w, mpctx->sh_video->disp_h,
+ width, height,
NULL, 0);
}
#endif
@@ -1158,14 +1162,14 @@ void init_vo_spudec(struct MPContext *mpctx)
if (vo_spudec==NULL && mpctx->stream->type==STREAMTYPE_DVDNAV) {
unsigned int *palette = mp_dvdnav_get_spu_clut(mpctx->stream);
current_module="spudec_init_dvdnav";
- vo_spudec=spudec_new_scaled(palette, mpctx->sh_video->disp_w, mpctx->sh_video->disp_h, NULL, 0);
+ vo_spudec=spudec_new_scaled(palette, width, height, NULL, 0);
}
#endif
if (vo_spudec==NULL) {
sh_sub_t *sh = mpctx->d_sub->sh;
current_module="spudec_init_normal";
- vo_spudec=spudec_new_scaled(NULL, mpctx->sh_video->disp_w, mpctx->sh_video->disp_h, sh->extradata, sh->extradata_len);
+ vo_spudec=spudec_new_scaled(NULL, width, height, sh->extradata, sh->extradata_len);
spudec_set_font_factor(vo_spudec,font_factor);
}