Commit 43f91baa authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

control/media_descriptor.c: Send a libvlc_MediaDescriptorFreed event, when the...

control/media_descriptor.c: Send a libvlc_MediaDescriptorFreed event, when the md is freed. (Patch by Enrique Osuna).
parent 8120e31b
......@@ -298,6 +298,7 @@ typedef enum libvlc_event_type_t {
libvlc_MediaDescriptorSubItemAdded,
libvlc_MediaDescriptorDurationChanged,
libvlc_MediaDescriptorPreparsedChanged,
libvlc_MediaDescriptorFreed,
libvlc_MediaInstancePlayed,
libvlc_MediaInstancePaused,
......@@ -343,6 +344,10 @@ typedef struct libvlc_event_t
{
int new_status;
} media_descriptor_preparsed_changed;
struct
{
libvlc_media_descriptor_t * md;
} media_descriptor_freed;
/* media instance */
struct
......
......@@ -261,6 +261,8 @@ libvlc_media_descriptor_t * libvlc_media_descriptor_new_from_input_item(
libvlc_MediaDescriptorMetaChanged, p_e );
libvlc_event_manager_register_event_type( p_md->p_event_manager,
libvlc_MediaDescriptorSubItemAdded, p_e );
libvlc_event_manager_register_event_type( p_md->p_event_manager,
libvlc_MediaDescriptorFreed, p_e );
libvlc_event_manager_register_event_type( p_md->p_event_manager,
libvlc_MediaDescriptorDurationChanged, p_e );
......@@ -316,6 +318,14 @@ void libvlc_media_descriptor_release( libvlc_media_descriptor_t *p_md )
uninstall_input_item_observer( p_md );
vlc_gc_decref( p_md->p_input_item );
/* Construct the event */
libvlc_event_t event;
event.type = libvlc_MediaDescriptorFreed;
event.u.media_descriptor_freed.md = p_md;
/* Send the event */
libvlc_event_send( p_md->p_event_manager, &event );
char ** all_keys = vlc_dictionary_all_keys( &p_md->tags );
for( i = 0; all_keys[i]; i++ )
{
......
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