Commit be5d7c28 authored by Thomas Guillem's avatar Thomas Guillem

libvlc: factor input_item_preparsed_changed

And don't re-send event, even if this can't happen with current vlc core.
parent 3703aab7
......@@ -213,17 +213,17 @@ static void input_item_duration_changed( const vlc_event_t *p_event,
libvlc_event_send( p_md->p_event_manager, &event );
}
/**************************************************************************
* input_item_preparsed_changed (Private) (vlc event Callback)
**************************************************************************/
static void input_item_preparsed_changed(const vlc_event_t *p_event,
void * user_data)
static void send_preparsed_event(libvlc_media_t *media)
{
libvlc_media_t *media = user_data;
libvlc_event_t event;
/* Eventually notify libvlc_media_parse() */
vlc_mutex_lock(&media->parsed_lock);
if (media->is_parsed == true)
{
vlc_mutex_unlock(&media->parsed_lock);
return;
}
media->is_parsed = true;
vlc_cond_broadcast(&media->parsed_cond);
vlc_mutex_unlock(&media->parsed_lock);
......@@ -231,13 +231,23 @@ static void input_item_preparsed_changed(const vlc_event_t *p_event,
/* Construct the event */
event.type = libvlc_MediaParsedChanged;
event.u.media_parsed_changed.new_status =
p_event->u.input_item_preparsed_changed.new_status;
event.u.media_parsed_changed.new_status = true;
/* Send the event */
libvlc_event_send(media->p_event_manager, &event);
}
/**************************************************************************
* input_item_preparsed_changed (Private) (vlc event Callback)
**************************************************************************/
static void input_item_preparsed_changed(const vlc_event_t *p_event,
void * user_data)
{
VLC_UNUSED( p_event );
libvlc_media_t *media = user_data;
send_preparsed_event(media);
}
/**************************************************************************
* input_item_preparse_ended (Private) (vlc event Callback)
**************************************************************************/
......
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