libvlc_media_descriptor_t * p_md; /* current media descriptor */
libvlc_event_manager_t * p_event_manager;
libvlc_drawable_t drawable;
+
+ vlc_bool_t b_own_its_input_thread;
};
struct libvlc_media_list_player_t
/* release for previous vlc_object_get */
vlc_object_release( p_input_thread );
- should_destroy = p_input_thread->p_internals->i_refcount == 1;
-
/* release for initial p_input_thread yield (see _new()) */
vlc_object_release( p_input_thread );
/* No one is tracking this input_thread appart us. Destroy it */
- if( should_destroy )
+ if( p_mi->b_own_its_input_thread )
{
/* We owned this one */
input_StopThread( p_input_thread );
{
/* XXX: hack the playlist doesn't retain the input thread,
* so we did it for the playlist (see _new_from_input_thread),
- * revert that here. */
+ * revert that here. This will be deleted with the playlist API */
vlc_object_release( p_input_thread );
}
}
* operation the refcount is 0, the object is destroyed.
* - Accessor _retain increase the refcount by 1 (XXX: to implement) */
p_mi->i_refcount = 1;
+ p_mi->b_own_its_input_thread = VLC_TRUE;
/* object_lock strategy:
* - No lock held in constructor
* - Lock when accessing all variable this lock is held
}
p_mi->i_input_id = p_input->i_object_id;
-
+ p_mi->b_own_its_input_thread = VLC_FALSE;
+
/* will be released in media_instance_release() */
vlc_object_yield( p_input );