mirror of
https://code.videolan.org/videolan/vlc
synced 2024-08-27 04:21:53 +02:00
control/media_descriptor.c: Send a libvlc_MediaDescriptorFreed event, when the md is freed. (Patch by Enrique Osuna).
This commit is contained in:
parent
8120e31bbd
commit
43f91baa3d
@ -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++ )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user