Commit 3fdc5f7c authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

control/media_instance.c: Retain the media descriptor, don't duplicate.

parent 2823cee5
...@@ -233,7 +233,8 @@ libvlc_media_instance_new_from_media_descriptor( ...@@ -233,7 +233,8 @@ libvlc_media_instance_new_from_media_descriptor(
if( !p_mi ) if( !p_mi )
return NULL; return NULL;
p_mi->p_md = libvlc_media_descriptor_duplicate( p_md ); libvlc_media_descriptor_retain( p_md );
p_mi->p_md = p_md;
return p_mi; return p_mi;
} }
...@@ -378,7 +379,8 @@ void libvlc_media_instance_set_media_descriptor( ...@@ -378,7 +379,8 @@ void libvlc_media_instance_set_media_descriptor(
return; /* It is ok to pass a NULL md */ return; /* It is ok to pass a NULL md */
} }
p_mi->p_md = libvlc_media_descriptor_duplicate( p_md ); libvlc_media_descriptor_retain( p_md );
p_mi->p_md = p_md;
/* The policy here is to ignore that we were created using a different /* The policy here is to ignore that we were created using a different
* libvlc_instance, because we don't really care */ * libvlc_instance, because we don't really care */
...@@ -400,7 +402,8 @@ libvlc_media_instance_get_media_descriptor( ...@@ -400,7 +402,8 @@ libvlc_media_instance_get_media_descriptor(
if( !p_mi->p_md ) if( !p_mi->p_md )
return NULL; return NULL;
return libvlc_media_descriptor_duplicate( p_mi->p_md ); libvlc_media_descriptor_retain( p_mi->p_md );
return p_mi->p_md;
} }
/************************************************************************** /**************************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment