]> git.sesse.net Git - vlc/blobdiff - src/misc/objects.c
Fix warning
[vlc] / src / misc / objects.c
index d72f8d870a4ddca28df41b8c037adc52cd8fa9b6..8e4f0ca9aa12b5b758870feead81c60fe8887319 100644 (file)
@@ -62,6 +62,9 @@
 # include <fcntl.h>
 # include <errno.h> /* ENOSYS */
 #endif
+#ifdef HAVE_SYS_EVENTFD_H
+# include <sys/eventfd.h>
+#endif
 #include <assert.h>
 
 /*****************************************************************************
@@ -90,13 +93,6 @@ static void vlc_object_dump( vlc_object_t *p_this );
 /*****************************************************************************
  * Local structure lock
  *****************************************************************************/
-static void close_nocancel (int fd)
-{
-    int canc = vlc_savecancel ();
-    close (fd);
-    vlc_restorecancel (canc);
-}
-
 static void libvlc_lock (libvlc_int_t *p_libvlc)
 {
     vlc_mutex_lock (&(libvlc_priv (p_libvlc)->structure_lock));
@@ -228,10 +224,6 @@ void * __vlc_object_create( vlc_object_t *p_this, int i_type )
             i_size = sizeof(decoder_t);
             psz_type = "packetizer";
             break;
-        case VLC_OBJECT_ENCODER:
-            i_size = sizeof(encoder_t);
-            psz_type = "encoder";
-            break;
         case VLC_OBJECT_AOUT:
             i_size = sizeof(aout_instance_t);
             psz_type = "audio output";
@@ -412,12 +404,15 @@ int vlc_object_waitpipe( vlc_object_t *obj )
         assert (internals->pipes[1] == -1);
 
 #ifdef HAVE_EVENTFD
-        if ((internals->pipes[0] = internals->pipes[1] = eventfd (0, 0)) == -1)
+        internals->pipes[0] = internals->pipes[1] = eventfd (0, 0);
+        if (internals->pipes[0] == -1)
 #endif
-        if (pipe (internals->pipes))
-            internals->pipes[0] = internals->pipes[1] = -1;
-        else
-        if (obj->b_die)
+        {
+            if (pipe (internals->pipes))
+                internals->pipes[0] = internals->pipes[1] = -1;
+        }
+
+        if (internals->pipes[0] != -1 && obj->b_die)
         {   /* Race condition: vlc_object_kill() already invoked! */
             msg_Dbg (obj, "waitpipe: object already dying");
             write (internals->pipes[1], &(uint64_t){ 1 }, sizeof (uint64_t));
@@ -779,7 +774,7 @@ void __vlc_object_detach( vlc_object_t *p_this )
  * This function recursively looks for a given object type. i_mode can be one
  * of FIND_PARENT, FIND_CHILD or FIND_ANYWHERE.
  *****************************************************************************/
-vlc_list_t * __vlc_list_find( vlc_object_t *p_this, int i_type, int i_mode )
+vlc_list_t * vlc_list_find( vlc_object_t *p_this, int i_type, int i_mode )
 {
     vlc_list_t *p_list;
     int i_count = 0;
@@ -788,7 +783,7 @@ vlc_list_t * __vlc_list_find( vlc_object_t *p_this, int i_type, int i_mode )
     switch( i_mode & 0x000f )
     {
     case FIND_ANYWHERE:
-        return vlc_list_find (p_this->p_libvlc, i_type, FIND_CHILD);
+        return vlc_list_find (VLC_OBJECT(p_this->p_libvlc), i_type, FIND_CHILD);
 
     case FIND_CHILD:
         libvlc_lock (p_this->p_libvlc);