* Local prototypes
*****************************************************************************/
static int Demux( demux_t *p_demux);
-static int Control( demux_t *p_demux, int i_query, va_list args );
static void parseEXTINF( char *psz_string, char **ppsz_artist, char **ppsz_name, int *pi_duration );
static bool ContainsURL( demux_t *p_demux );
return IsUTF8 (str) ? strdup (str) : FromLatin1 (str);
}
+static char *CheckUnicode (const char *str)
+{
+ return IsUTF8 (str) ? strdup (str): NULL;
+}
+
/*****************************************************************************
* Import_M3U: main import function
*****************************************************************************/
char *(*pf_dup) (const char *);
if( POKE( p_peek, "RTSPtext", 8 ) /* QuickTime */
+ || POKE( p_peek, "\xef\xbb\xbf" "#EXTM3U", 10) /* BOM at start */
|| demux_IsPathExtension( p_demux, ".m3u8" )
|| demux_IsForced( p_demux, "m3u8" ) )
- pf_dup = strdup; /* UTF-8 */
+ pf_dup = CheckUnicode; /* UTF-8 */
else
if( POKE( p_peek, "#EXTM3U", 7 )
|| demux_IsPathExtension( p_demux, ".m3u" )
while( p_peek + sizeof( "https://" ) < p_peek_end )
{
- /* One line starting with an URL is enough */
+ /* One line starting with a URL is enough */
if( !strncasecmp( (const char *)p_peek, "http://", 7 ) ||
!strncasecmp( (const char *)p_peek, "mms://", 6 ) ||
!strncasecmp( (const char *)p_peek, "rtsp://", 7 ) ||
b_cleanup = true;
if( !psz_mrl )
{
- LocaleFree( psz_parse );
+ free( psz_parse );
goto error;
}
- p_input = input_item_NewExt( p_demux, psz_mrl, psz_name,
+ p_input = input_item_NewExt( psz_mrl, psz_name,
i_options, ppsz_options, 0, i_duration );
- LocaleFree( psz_parse );
+ free( psz_parse );
free( psz_mrl );
if ( !EMPTY_STR(psz_artist) )
return 0; /* Needed for correct operation of go back */
}
-static int Control( demux_t *p_demux, int i_query, va_list args )
-{
- VLC_UNUSED(p_demux); VLC_UNUSED(i_query); VLC_UNUSED(args);
- return VLC_EGENERIC;
-}
-
static void parseEXTINF(char *psz_string, char **ppsz_artist,
char **ppsz_name, int *pi_duration)
{