[vlc-devel] [RFC PATCH 0/2] libvlc_MediaListEndReached not sent when media doesn't have sub items

Thomas Guillem thomas at gllm.fr
Tue Feb 3 19:04:10 CET 2015


Hi,

The libvlc_MediaListEndReached event is not sent when the parsed media doesn't
have any subitems. Receiving this event when there is no media could be useful
in order to get notified when browsing is finished.

A solution to solve this issue is to send the libvlc_MediaListEndReached event
when the function input_Preparse ends (called from playlist/preparser.c). To
get notified when input_Preparse ends I can listen to
vlc_InputItemPreparsedChanged core events that is sent from
input_item_SetPreparsed.

My main issue with this solution is that input_item_SetPreparsed is called too
early from the EsOutMeta function in input/es_out.c. It's called before the
Mainloop (that parse for sub items) in input_Preparse. The result is that I
receive the libvlc_MediaListEndReached event before ibvlc_MediaListItemAdded
events.

The most obvious fix is to not call es_out_ControlSetMeta from the function
Init if we are preparsing. But it's maybe to hackish... I could also remove
input_item_SetPreparsed from EsOutMeta and add it in input/input.c after Init
calls (in input_Read, Run, and input_Preparse). I can also add an other new
core event to get notified when input_Preparse ends, but how do I name it since
ITEM_PREPARSED is already taken ?

I could use your advice about a proper solution.

Regards,
Thomas Guillem.

Thomas Guillem (2):
  input: don't set es_out meta while preparsing
  lib/media: fix MediaListEndReached not sent when media doesn't have
    sub items

 lib/media.c       | 30 +++++++++++++++---------------
 src/input/input.c |  3 ++-
 2 files changed, 17 insertions(+), 16 deletions(-)

-- 
2.1.3




More information about the vlc-devel mailing list