[vlc-commits] demux/codec: webvtt: fix multiple lines NOTE sections
Francois Cartegnie
git at videolan.org
Thu Oct 26 20:02:36 CEST 2017
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Oct 26 19:58:37 2017 +0200| [2d8f10094c4226a5deec1ff0e5a9c95ffd63a247] | committer: Francois Cartegnie
demux/codec: webvtt: fix multiple lines NOTE sections
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2d8f10094c4226a5deec1ff0e5a9c95ffd63a247
---
modules/codec/webvtt/webvtt.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/modules/codec/webvtt/webvtt.c b/modules/codec/webvtt/webvtt.c
index 3d66af02af..ef3c7eecc0 100644
--- a/modules/codec/webvtt/webvtt.c
+++ b/modules/codec/webvtt/webvtt.c
@@ -59,6 +59,7 @@ struct webvtt_text_parser_t
WEBVTT_SECTION_UNDEFINED = WEBVTT_HEADER_STYLE - 1,
WEBVTT_SECTION_STYLE = WEBVTT_HEADER_STYLE,
WEBVTT_SECTION_REGION = WEBVTT_HEADER_REGION,
+ WEBVTT_SECTION_NOTE,
WEBVTT_SECTION_CUES,
} section;
char * reads[3];
@@ -188,6 +189,7 @@ void webvtt_text_parser_Feed( webvtt_text_parser_t *p, char *psz_line )
}
else if( KeywordMatch( psz_line, "NOTE" ) )
{
+ p->section = WEBVTT_SECTION_NOTE;
return;
}
else if( psz_line[0] != 0 )
@@ -254,4 +256,9 @@ void webvtt_text_parser_Feed( webvtt_text_parser_t *p, char *psz_line )
if( psz_line[0] == 0 ) /* End of region declaration */
p->section = WEBVTT_SECTION_UNDEFINED;
}
+ else if( p->section == WEBVTT_SECTION_NOTE )
+ {
+ if( psz_line[0] == 0 )
+ p->section = WEBVTT_SECTION_UNDEFINED;
+ }
}
More information about the vlc-commits
mailing list