[vlc-devel] [PATCH] Look-up variable just when opening the decoder, and not every time the text is parsed.

Tomer Barletz barletz at gmail.com
Tue Jun 14 21:12:12 CEST 2011


---
 modules/codec/stl.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/modules/codec/stl.c b/modules/codec/stl.c
index 981333f..6d2b95d 100644
--- a/modules/codec/stl.c
+++ b/modules/codec/stl.c
@@ -69,6 +69,7 @@ typedef struct {
 
 struct decoder_sys_t {
     cct_number_value_t cct;
+    int i_align;
 };
 
 static cct_number_t cct_nums[] = { {CCT_ISO_6937_2, "ISO_6937-2"},
@@ -165,6 +166,7 @@ static subpicture_t *Decode(decoder_t *dec, block_t **block)
                                             payload_size,
                                             cct_nums[dec->p_sys->cct - CCT_BEGIN].str);
         sub->p_region->psz_html = NULL;
+        sub->p_region->i_align = SUBPICTURE_ALIGN_BOTTOM | dec->p_sys->i_align;
     }
 
     free(payload);
@@ -217,6 +219,7 @@ static int Open(vlc_object_t *object)
         return VLC_ENOMEM;
 
     sys->cct = cct;
+    sys->i_align = var_InheritInteger(dec, "subsdec-align");
 
     dec->p_sys = sys;
     dec->pf_decode_sub = Decode;
-- 
1.7.4.1




More information about the vlc-devel mailing list