[vlc-devel] [PATCH] Do not detect all files with BOM as m3u playlists
Rémi Denis-Courmont
remi at remlab.net
Thu Aug 22 18:46:36 CEST 2013
Le jeudi 22 août 2013 18:36:09 Rafaël Carré a écrit :
> Close #9237
> ---
> modules/demux/playlist/m3u.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/modules/demux/playlist/m3u.c b/modules/demux/playlist/m3u.c
> index a942005..fad765e 100644
> --- a/modules/demux/playlist/m3u.c
> +++ b/modules/demux/playlist/m3u.c
> @@ -70,12 +70,6 @@ int Import_M3U( vlc_object_t *p_this )
> CHECK_PEEK( p_peek, 8 );
> char *(*pf_dup) (const char *);
>
> - if( POKE( p_peek, "\xef\xbb\xbf", 3) )/* BOM at start */
> - {
> - pf_dup = CheckUnicode; /* UTF-8 */
> - stream_Seek( p_demux->s, 3 );
> - }
> - else
> if( POKE( p_peek, "RTSPtext", 8 ) /* QuickTime */
>
> || demux_IsPathExtension( p_demux, ".m3u8" )
> || demux_IsForced( p_demux, "m3u8" )
>
> @@ -92,6 +86,12 @@ int Import_M3U( vlc_object_t *p_this )
> else
> return VLC_EGENERIC;
>
> + if( POKE( p_peek, "\xef\xbb\xbf", 3) )/* BOM at start */
> + {
> + pf_dup = CheckUnicode; /* UTF-8 */
> + stream_Seek( p_demux->s, 3 );
> + }
I don't think this works if the BOM precedes #EXT which was the whole point of
the previous/original patch.
> +
> STANDARD_DEMUX_INIT_MSG( "found valid M3U playlist" );
> p_demux->p_sys->psz_prefix = FindPrefix( p_demux );
> p_demux->p_sys->pf_dup = pf_dup;
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the vlc-devel
mailing list