Skip to content
Snippets Groups Projects
Commit cf14bc8f authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

Revert "lib: media: Use an atomic refcounter"

This reverts commit 1b07eaa8.
parent b3e904ab
No related branches found
No related tags found
No related merge requests found
Pipeline #10602 failed with stage
in 24 minutes and 26 seconds
......@@ -394,7 +394,7 @@ libvlc_media_t * libvlc_media_new_from_input_item(
p_md->p_libvlc_instance = p_instance;
p_md->p_input_item = p_input_item;
vlc_atomic_rc_init(&p_md->refcount);
p_md->i_refcount = 1;
vlc_cond_init(&p_md->parsed_cond);
vlc_mutex_init(&p_md->parsed_lock);
......@@ -547,7 +547,9 @@ void libvlc_media_release( libvlc_media_t *p_md )
if (!p_md)
return;
if(!vlc_atomic_rc_dec( &p_md->refcount ))
p_md->i_refcount--;
if( p_md->i_refcount > 0 )
return;
uninstall_input_item_observer( p_md );
......@@ -583,7 +585,7 @@ void libvlc_media_release( libvlc_media_t *p_md )
void libvlc_media_retain( libvlc_media_t *p_md )
{
assert (p_md);
vlc_atomic_rc_inc(&p_md->refcount);
p_md->i_refcount++;
}
/**************************************************************************
......
......@@ -29,13 +29,12 @@
#include <vlc_common.h>
#include <vlc_input.h>
#include <vlc_atomic.h>
struct libvlc_media_t
{
libvlc_event_manager_t event_manager;
input_item_t *p_input_item;
vlc_atomic_rc_t refcount;
int i_refcount;
libvlc_instance_t *p_libvlc_instance;
libvlc_state_t state;
VLC_FORWARD_DECLARE_OBJECT(libvlc_media_list_t*) p_subitems; /* A media descriptor can have Sub items. This is the only dependancy we really have on media_list */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment