if( ( p_dir = utf8_opendir( psz_dir ) ) == NULL )
{
- msg_Err( p_intf, "cannot open dir (%s)", psz_dir );
+ msg_Err( p_intf, "cannot open directory (%s)", psz_dir );
return VLC_EGENERIC;
}
i_dirlen = strlen( psz_dir );
if( i_dirlen + 10 > MAX_DIR_SIZE )
{
- msg_Warn( p_intf, "skipping too deep dir (%s)", psz_dir );
+ msg_Warn( p_intf, "skipping too deep directory (%s)", psz_dir );
return 0;
}
if( !f->b_handler )
{
+ char *psz_type = strdup( p_sys->psz_html_type );
+ if( strstr( &dir[strlen( psz_root )], ".xml" ) )
+ {
+ char *psz = strstr( psz_type, "html;" );
+ if( psz )
+ {
+ psz[0] = 'x';
+ psz[1] = 'm';
+ psz[2] = 'l';
+ psz[3] = ';';
+ psz[4] = ' ';
+ }
+ }
f->p_file = httpd_FileNew( p_sys->p_httpd_host,
f->name,
- f->b_html ? ( strstr( &dir[strlen( psz_root )], ".xml" ) ? "text/xml; charset=UTF-8" : p_sys->psz_html_type ) :
- NULL,
+ f->b_html ? psz_type : NULL,
user, password, p_acl,
E_(HttpCallback), f );
+ free( psz_type );
if( f->p_file != NULL )
{
TAB_APPEND( p_sys->i_files, p_sys->pp_files, f );
char *psz_out = psz_local;
size_t i_ret;
char psz_tmp[i_in + 1];
- char *psz_in = psz_tmp;
- uint8_t *p = (uint8_t *)psz_tmp;
+ const char *psz_in = psz_tmp;
strcpy( psz_tmp, psz_utf8 );
- /* Fix Unicode quotes. If we are here we are probably converting
- * to an inferior charset not understanding Unicode quotes. */
- while( *p )
- {
- if( p[0] == 0xe2 && p[1] == 0x80 && p[2] == 0x99 )
- {
- *p = '\'';
- memmove( &p[1], &p[3], strlen((char *)&p[3]) + 1 );
- }
- if( p[0] == 0xe2 && p[1] == 0x80 && p[2] == 0x9a )
- {
- *p = '"';
- memmove( &p[1], &p[3], strlen((char *)&p[3]) + 1 );
- }
- p++;
- }
i_in = strlen( psz_tmp );
i_ret = vlc_iconv( p_sys->iconv_from_utf8, &psz_in, &i_in,
if ( p_sys->iconv_to_utf8 != (vlc_iconv_t)-1 )
{
- char *psz_in = psz_local;
+ const char *psz_in = psz_local;
size_t i_in = strlen(psz_in);
size_t i_out = i_in * 6;
char *psz_utf8 = malloc(i_out + 1);
sprintf( value, "%d", i_depth );
E_(mvar_AppendNewVar)( itm, "depth", value );
+ if( p_node->i_flags & PLAYLIST_RO_FLAG )
+ {
+ E_(mvar_AppendNewVar)( itm, "ro", "ro" );
+ }
+ else
+ {
+ E_(mvar_AppendNewVar)( itm, "ro", "rw" );
+ }
+
+ sprintf( value, "%ld", (long)p_node->input.i_duration );
+ E_(mvar_AppendNewVar)( itm, "duration", value );
+
E_(mvar_AppendVar)( s, itm );
}
else
sprintf( value, "%d", i_depth );
E_(mvar_AppendNewVar)( itm, "depth", value );
+ if( p_node->i_flags & PLAYLIST_RO_FLAG )
+ {
+ E_(mvar_AppendNewVar)( itm, "ro", "ro" );
+ }
+ else
+ {
+ E_(mvar_AppendNewVar)( itm, "ro", "rw" );
+ }
+
E_(mvar_AppendVar)( s, itm );
for (i_child = 0 ; i_child < p_node->i_children ; i_child++)
{
i_value += 3600 * i_stock;
i_stock = 0;
- /* other characters which are not numbers are not important */
- while( ((p_value[0] < '0') || (p_value[0] > '9')) && (p_value[0] != '\0') )
+ /* other characters which are not numbers are not
+ * important */
+ while( ((p_value[0] < '0') || (p_value[0] > '9'))
+ && (p_value[0] != '\0') )
{
p_value++;
}
i_value += 60 * i_stock;
i_stock = 0;
p_value++;
- while( ((p_value[0] < '0') || (p_value[0] > '9')) && (p_value[0] != '\0') )
+ while( ((p_value[0] < '0') || (p_value[0] > '9'))
+ && (p_value[0] != '\0') )
{
p_value++;
}
{
i_value += i_stock;
i_stock = 0;
- while( ((p_value[0] < '0') || (p_value[0] > '9')) && (p_value[0] != '\0') )
+ while( ((p_value[0] < '0') || (p_value[0] > '9'))
+ && (p_value[0] != '\0') )
{
p_value++;
}
}
}
- /* if there is no known symbol, I consider it as seconds. Otherwise, i_stock = 0 */
+ /* if there is no known symbol, I consider it as seconds.
+ * Otherwise, i_stock = 0 */
i_value += i_stock;
switch(i_relative)
}
case POSITION_ABSOLUTE:
{
- val.f_float = __MIN( __MAX( ((float) i_value ) / 100.0 , 0.0 ) , 100.0 );
+ val.f_float = __MIN( __MAX( ((float) i_value ) / 100.0 ,
+ 0.0 ), 100.0 );
var_Set( p_sys->p_input, "position", val );
- msg_Dbg( p_intf, "requested seek percent: %d", i_value );
+ msg_Dbg( p_intf, "requested seek percent: %d%%", i_value );
break;
}
case POSITION_REL_FOR:
{
var_Get( p_sys->p_input, "position", &val );
- val.f_float += __MIN( __MAX( ((float) i_value ) / 100.0 , 0.0 ) , 100.0 );
+ val.f_float += __MIN( __MAX( ((float) i_value ) / 100.0,
+ 0.0 ) , 100.0 );
var_Set( p_sys->p_input, "position", val );
- msg_Dbg( p_intf, "requested seek percent forward: %d", i_value );
+ msg_Dbg( p_intf, "requested seek percent forward: %d%%",
+ i_value );
break;
}
case POSITION_REL_BACK:
{
var_Get( p_sys->p_input, "position", &val );
- val.f_float -= __MIN( __MAX( ((float) i_value ) / 100.0 , 0.0 ) , 100.0 );
+ val.f_float -= __MIN( __MAX( ((float) i_value ) / 100.0,
+ 0.0 ) , 100.0 );
var_Set( p_sys->p_input, "position", val );
- msg_Dbg( p_intf, "requested seek percent backward: %d", i_value );
+ msg_Dbg( p_intf, "requested seek percent backward: %d%%",
+ i_value );
break;
}
default:
{
- msg_Dbg( p_intf, "requested seek: what the f*** is going on here ?" );
+ msg_Dbg( p_intf, "invalid seek request" );
break;
}
}
playlist_item_t * p_item = NULL;
/* In case there is spaces before the mrl */
- while( ( *s_mrl == ' ' ) && ( *s_mrl != '\0' ) )
- {
+ while( *s_mrl == ' ' )
s_mrl++;
- }
/* extract the mrl */
s_temp = strstr( s_mrl , " :" );