changeset 33574:1a7606be0b94

Factor out a tiny bit of common code.
author reimar
date Sun, 19 Jun 2011 16:05:35 +0000
parents 42b250e4f40e
children 052789583781
files mplayer.c
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mplayer.c	Sun Jun 19 15:35:58 2011 +0000
+++ b/mplayer.c	Sun Jun 19 16:05:35 2011 +0000
@@ -1155,6 +1155,7 @@
 
 void init_vo_spudec(void)
 {
+    unsigned width, height;
     spudec_free(vo_spudec);
     vo_spudec = NULL;
 
@@ -1163,17 +1164,20 @@
         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
@@ -1182,14 +1186,14 @@
     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);
     }