# include <fcntl.h>
# include <errno.h> /* ENOSYS */
#endif
+#ifdef HAVE_SYS_EVENTFD_H
+# include <sys/eventfd.h>
+#endif
#include <assert.h>
/*****************************************************************************
/*****************************************************************************
* 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));
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";
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));
* 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;
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);