[vlc-commits] codec: cc: fix replay tv multiple packets per private data

Francois Cartegnie git at videolan.org
Sun Oct 30 14:06:18 CET 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sat Oct 29 16:50:40 2016 +0200| [23d9a7c4b54e104bfb1cd77809d79dba2c7c7389] | committer: Francois Cartegnie

codec: cc: fix replay tv multiple packets per private data

according to samples, there always can be more than 8 bytes

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

 modules/codec/cc.h | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/modules/codec/cc.h b/modules/codec/cc.h
index 8605102..8416821 100644
--- a/modules/codec/cc.h
+++ b/modules/codec/cc.h
@@ -253,15 +253,12 @@ static inline void cc_Extract( cc_data_t *c, bool b_top_field_first, const uint8
     else if( i_payload_type == CC_PAYLOAD_REPLAYTV )
     {
         const uint8_t *cc = &p_src[0];
-        int i;
-        if( c->i_data + 2*3 > CC_MAX_DATA_SIZE )
-            return;
-
-        for( i = 0; i < 2; i++, cc += 4 )
+        for( int i_cc_count = i_src >> 2; i_cc_count > 0;
+             i_cc_count--, cc += 4 )
         {
-            const int i_field = i == 0 ? 1 : 0;
-
-            cc_AppendData( c, CC_PKT_BYTE0(i_field), &cc[2] );
+            if( c->i_data + 3 > CC_MAX_DATA_SIZE )
+                return;
+            cc_AppendData( c, CC_PKT_BYTE0(i_cc_count % 2), &cc[2] );
         }
         c->b_reorder = false;
     }



More information about the vlc-commits mailing list