[vlc-devel] [vlc-commits] demux: ttml: probe document header less xml
Rémi Denis-Courmont
remi at remlab.net
Fri May 26 12:03:40 CEST 2017
On May 26, 2017 11:49:37 AM GMT+02:00, Francois Cartegnie <git at videolan.org> wrote:
>vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri May
>26 11:00:06 2017 +0200| [ee1a36541b1826962339dbc7d40adf80fb035ba4] |
>committer: Francois Cartegnie
>
>demux: ttml: probe document header less xml
>
>>
>http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ee1a36541b1826962339dbc7d40adf80fb035ba4
>---
>
> modules/demux/ttml.c | 18 ++++++++++++------
> 1 file changed, 12 insertions(+), 6 deletions(-)
>
>diff --git a/modules/demux/ttml.c b/modules/demux/ttml.c
>index 6c81292bc4..0569e010a3 100644
>--- a/modules/demux/ttml.c
>+++ b/modules/demux/ttml.c
>@@ -408,20 +408,26 @@ int OpenDemux( vlc_object_t* p_this )
> switch( GetQWBE(p_peek) )
> {
> /* See RFC 3023 Part 4 */
>- case 0xFFFE3C003F007800UL: /* UTF16 BOM<?xml */
>- case 0xFEFF003C003F0078UL: /* UTF16 BOM<?xml */
>+ case 0xFFFE3C003F007800UL: /* UTF16 BOM<? */
>+ case 0xFFFE3C003F007400UL: /* UTF16 BOM<t */
>+ case 0xFEFF003C003F0078UL: /* UTF16 BOM<? */
>+ case 0xFEFF003C003F0074UL: /* UTF16 BOM<t */
> psz_alloc = FromCharset( "UTF-16", p_peek, i_peek );
> break;
>- case 0x3C003F0078006D00UL: /* UTF16-LE <?xml */
>+ case 0x3C003F0078006D00UL: /* UTF16-LE <?xm */
>+ case 0x3C003F0074007400UL: /* UTF16-LE <tt */
> psz_alloc = FromCharset( "UTF-16LE", p_peek, i_peek );
> break;
>- case 0x003C003F0078006DUL: /* UTF16-BE <?xml */
>+ case 0x003C003F0078006DUL: /* UTF16-BE <?xm */
>+ case 0x003C003F00740074UL: /* UTF16-BE <tt */
> psz_alloc = FromCharset( "UTF-16BE", p_peek, i_peek );
> break;
>- case 0x3C3F786D6C207665UL: /* UTF8 <?xml */
>+ case 0xEFBBBF3C3F786D20UL: /* UTF8 BOM<?xml */
>+ case 0xEFBBBF3C74742078UL: /* UTF8 BOM<tt x*/
> break;
> default:
>- return VLC_EGENERIC;
>+ if(GetDWBE(p_peek) != 0x3C747420U) /* tt node without xml
>document marker */
>+ return VLC_EGENERIC;
> }
>
> if( psz_alloc )
>
>_______________________________________________
>vlc-commits mailing list
>vlc-commits at videolan.org
>https://mailman.videolan.org/listinfo/vlc-commits
Was this ever tested in 32-bits ISA or on Win64? I don't see how this can work w/o UINT64_C.
--
Rémi Denis-Courmont
More information about the vlc-devel
mailing list