[vlc-commits] codec: cc: don't discard good byte sequences
Steven Toth
git at videolan.org
Thu Sep 22 21:29:53 CEST 2016
vlc | branch: master | Steven Toth <stoth at kernellabs.com> | Thu Mar 17 08:29:22 2016 -0400| [f32069ff37c64fef50f8d484f929455792385f5f] | committer: Francois Cartegnie
codec: cc: don't discard good byte sequences
p_buffer[0] doesn't always contain just the field 0 or 1.
It often contains two other bitmask fields. Ensure we
complare the field value only via a bitmask, else
we can discard perfectly good CC data.
Signed-off-by: Francois Cartegnie <fcvlcdev at free.fr>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f32069ff37c64fef50f8d484f929455792385f5f
---
modules/codec/cc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/modules/codec/cc.c b/modules/codec/cc.c
index 006015e..d5f10b9 100644
--- a/modules/codec/cc.c
+++ b/modules/codec/cc.c
@@ -466,7 +466,8 @@ static subpicture_t *Convert( decoder_t *p_dec, block_t **pp_block )
/* TODO do the real decoding here */
while( p_block->i_buffer >= 3 && !(i_status & EIA608_STATUS_DISPLAY) )
{
- if( p_block->p_buffer[0] == p_sys->i_field )
+ /* Mask off the specific i_field bit, else some sequences can be lost. */
+ if ( (p_block->p_buffer[0] & 0x01) == p_sys->i_field )
i_status = Eia608Parse( &p_sys->eia608, p_sys->i_channel, &p_block->p_buffer[1] );
p_block->i_buffer -= 3;
More information about the vlc-commits
mailing list