]> git.sesse.net Git - vlc/blobdiff - modules/access/directory.c
Use pl_Release with the right argument.
[vlc] / modules / access / directory.c
index 124bba878064ef184e30b747d69283b2c8882a78..51ea50b3c13284bd673bdc719220c8cb1fe57b00 100644 (file)
@@ -30,6 +30,7 @@
 # include "config.h"
 #endif
 
+#include <assert.h>
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #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|