[vlc-commits] codec: stl: missing style reset between blocks

Francois Cartegnie git at videolan.org
Sun Feb 12 13:47:31 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Feb 12 13:46:12 2017 +0100| [371184a5f1f1ce9892b8a2e3455d9eafb3d4da53] | committer: Francois Cartegnie

codec: stl: missing style reset between blocks

unwanted style propagation on non teletext

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=371184a5f1f1ce9892b8a2e3455d9eafb3d4da53
---

 modules/codec/stl.c | 25 ++++++++++++++++++++-----
 1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/modules/codec/stl.c b/modules/codec/stl.c
index a57dadf..95da137 100644
--- a/modules/codec/stl.c
+++ b/modules/codec/stl.c
@@ -355,12 +355,25 @@ static void ResetGroups(decoder_sys_t *p_sys)
 {
     for(size_t i=0; i<=STL_GROUPS_MAX; i++)
     {
-        if(p_sys->groups[i].p_segment)
-            text_segment_ChainDelete(p_sys->groups[i].p_segment);
-        if(p_sys->groups[i].p_style)
-            text_style_Delete(p_sys->groups[i].p_style);
+        stl_sg_t *p_group = &p_sys->groups[i];
+        if(p_group->p_segment)
+        {
+            text_segment_ChainDelete(p_group->p_segment);
+            p_group->p_segment = NULL;
+            p_group->pp_segment_last = &p_group->p_segment;
+        }
+
+        if(p_group->p_style)
+        {
+            text_style_Delete(p_group->p_style);
+            p_group->p_style = NULL;
+        }
+
+        p_group->i_accumulating = false;
+        p_group->i_end = 0;
+        p_group->i_start = 0;
+        p_group->i_justify = 0;
     }
-    memset(p_sys->groups, 0, sizeof(stl_sg_t) * (STL_GROUPS_MAX + 1));
 }
 
 static int Decode(decoder_t *p_dec, block_t *p_block)
@@ -413,6 +426,8 @@ static int Decode(decoder_t *p_dec, block_t *p_block)
         }
     }
 
+    ResetGroups(p_dec->p_sys);
+
     block_Release(p_block);
     return VLCDEC_SUCCESS;
 }



More information about the vlc-commits mailing list