[vlc-devel] [PATCH] Don't fill region if page_state == 0

bjorn at haxx.se bjorn at haxx.se
Fri Jun 18 13:52:27 CEST 2010


From: Björn Stenberg <bjorn at haxx.se>

My interpretation of ETSI EN 300 743 is that the region_fill_flag of a region composition segment should not cause the region to be overwritten when the containing page composition segment has its' page_state variable set to 0 (page update).
---
 modules/codec/dvbsub.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/modules/codec/dvbsub.c b/modules/codec/dvbsub.c
index fb7619c..9dda6f6 100644
--- a/modules/codec/dvbsub.c
+++ b/modules/codec/dvbsub.c
@@ -806,6 +806,7 @@ static void decode_page_composition( decoder_t *p_dec, bs_t *s )
 
     p_sys->p_page->i_version = i_version;
     p_sys->p_page->i_timeout = i_timeout;
+    p_sys->p_page->i_state = i_state;
     p_sys->b_page = true;
 
     /* Number of regions */
@@ -840,7 +841,8 @@ static void decode_region_composition( decoder_t *p_dec, bs_t *s )
     int i_segment_length, i_processed_length, i_id, i_version;
     int i_width, i_height, i_level_comp, i_depth, i_clut;
     int i_8_bg, i_4_bg, i_2_bg;
-    bool b_fill;
+    bool b_region_fill, b_fill = false;
+    dvbsub_page_t *p_page = p_sys->p_page;
 
     i_segment_length = bs_read( s, 16 );
     i_id = bs_read( s, 8 );
@@ -877,7 +879,7 @@ static void decode_region_composition( decoder_t *p_dec, bs_t *s )
     /* Region attributes */
     p_region->i_id = i_id;
     p_region->i_version = i_version;
-    b_fill = bs_read( s, 1 );
+    b_region_fill = bs_read( s, 1 );
     bs_skip( s, 3 ); /* Reserved */
 
     i_width = bs_read( s, 16 );
@@ -917,6 +919,10 @@ static void decode_region_composition( decoder_t *p_dec, bs_t *s )
         p_region->i_depth = 0;
         b_fill = true;
     }
+    else
+        if (b_region_fill && p_page->i_state != 0)
+            b_fill = true;
+
     if( p_region->i_depth &&
         ( ( p_region->i_depth != i_depth ) ||
           ( p_region->i_level_comp != i_level_comp ) ||
-- 
1.7.1




More information about the vlc-devel mailing list