X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Faccess%2Fdirectory.c;h=51ea50b3c13284bd673bdc719220c8cb1fe57b00;hb=415ada5a217873f17211bb7b3d96ce45d6d67263;hp=124bba878064ef184e30b747d69283b2c8882a78;hpb=494ace96d068ee8e4b6b689da0ae469c0c0e4fe3;p=vlc diff --git a/modules/access/directory.c b/modules/access/directory.c index 124bba8780..51ea50b3c1 100644 --- a/modules/access/directory.c +++ b/modules/access/directory.c @@ -30,6 +30,7 @@ # include "config.h" #endif +#include #include #include #warning playlist code must not be used here. @@ -215,7 +216,7 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len) if( !p_input ) { msg_Err( p_access, "unable to find input (internal error)" ); - vlc_object_release( p_playlist ); + pl_Release( p_access ); return VLC_ENOOBJ; } @@ -226,7 +227,7 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len) { msg_Err( p_access, "unable to find item in playlist" ); vlc_object_release( p_input ); - vlc_object_release( p_playlist ); + pl_Release( p_access ); return VLC_ENOOBJ; } @@ -255,6 +256,7 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len) p_current->p_input->i_type = ITEM_TYPE_DIRECTORY; p_item_in_category = playlist_ItemToNode( p_playlist, p_current, pl_Unlocked ); + assert( p_item_in_category ); ReadDir( p_access, p_playlist, psz_name, i_mode, p_item_in_category, @@ -264,7 +266,7 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len) free( psz_name ); vlc_object_release( p_input ); - vlc_object_release( p_playlist ); + pl_Release( p_access ); /* Return fake data forever */ p_access->pf_read = ReadNull; @@ -493,7 +495,7 @@ static int ReadDir( access_t *p_access, playlist_t *p_playlist, p_parent_category, PLAYLIST_NO_REBUILD, NULL ); PL_UNLOCK; - + assert( p_node ); /* If we had the parent in category, the it is now node. * Else, we still don't have */ i_return = ReadDir( p_access, p_playlist, psz_uri , MODE_EXPAND, @@ -535,6 +537,7 @@ static int ReadDir( access_t *p_access, playlist_t *p_playlist, { if( p_current_input ) input_ItemCopyOptions( p_current_input, p_input ); + assert( p_parent_category ); int i_ret = playlist_BothAddInput( p_playlist, p_input, p_parent_category, PLAYLIST_APPEND|PLAYLIST_PREPARSE|