Commit d8712f2a authored by Clément Stenac's avatar Clément Stenac

No need to GuessType on directory content

parent b56b80d6
......@@ -264,6 +264,7 @@ VLC_EXPORT( vlc_bool_t, playlist_IsServicesDiscoveryLoaded, ( playlist_t *,const
#define playlist_AddItem(p,pi,i1,i2) playlist_ItemAdd(p,pi,i1,i2)
#define playlist_ItemNew( a , b, c ) __playlist_ItemNew(VLC_OBJECT(a) , b , c )
VLC_EXPORT( playlist_item_t* , __playlist_ItemNew, ( vlc_object_t *,const char *,const char * ) );
VLC_EXPORT( playlist_item_t* , playlist_ItemNewWithType, ( vlc_object_t *,const char *,const char *, int ) );
VLC_EXPORT( int, playlist_ItemDelete, ( playlist_item_t * ) );
VLC_EXPORT( int, playlist_ItemAddParent, ( playlist_item_t *, int,playlist_item_t *) );
VLC_EXPORT( int, playlist_CopyParents, ( playlist_item_t *,playlist_item_t *) );
......
......@@ -477,8 +477,11 @@ static int ReadDir( playlist_t *p_playlist,
}
else
{
playlist_item_t *p_item = playlist_ItemNew( p_playlist,
psz_uri, p_dir_content->d_name );
playlist_item_t *p_item = playlist_ItemNewWithType(
p_playlist,
psz_uri,
p_dir_content->d_name,
ITEM_TYPE_FILE );
playlist_NodeAddItem( p_playlist,p_item,
p_parent->pp_parents[0]->i_view,
p_parent,
......
......@@ -39,9 +39,19 @@ static void GuessType( input_item_t *p_item);
* \param psz_name a text giving a name or description of the item
* \return the new item or NULL on failure
*/
playlist_item_t * __playlist_ItemNew( vlc_object_t *p_obj,
const char *psz_uri,
const char *psz_name )
{
return playlist_ItemNewWithType( p_obj, psz_uri,
psz_name, ITEM_TYPE_UNKNOWN );
}
playlist_item_t * playlist_ItemNewWithType( vlc_object_t *p_obj,
const char *psz_uri,
const char *psz_name,
int i_type )
{
playlist_item_t * p_item;
......@@ -57,6 +67,8 @@ playlist_item_t * __playlist_ItemNew( vlc_object_t *p_obj,
if( psz_name != NULL ) p_item->input.psz_name = strdup( psz_name );
else p_item->input.psz_name = strdup ( psz_uri );
p_item->input.i_type = i_type;
p_item->b_enabled = VLC_TRUE;
p_item->i_nb_played = 0;
......@@ -72,7 +84,8 @@ playlist_item_t * __playlist_ItemNew( vlc_object_t *p_obj,
vlc_mutex_init( p_obj, &p_item->input.lock );
GuessType( &p_item->input );
if( p_item->input.i_type == ITEM_TYPE_UNKNOWN )
GuessType( &p_item->input );
playlist_ItemCreateCategory( p_item, _("General") );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment