Commit 8a449a61 authored by Thomas Guillem's avatar Thomas Guillem

libvlc: add libvlc_media_parse_stop

parent f63fcbdd
......@@ -648,6 +648,8 @@ LIBVLC_API libvlc_time_t
* these flags can be combined. By default, media is parsed if it's a local
* file.
*
* \note Parsing can be aborted with libvlc_media_parse_stop().
*
* \see libvlc_MediaParsedChanged
* \see libvlc_media_get_meta
* \see libvlc_media_tracks_get
......@@ -667,6 +669,20 @@ libvlc_media_parse_with_options( libvlc_media_t *p_md,
libvlc_media_parse_flag_t parse_flag,
int timeout );
/**
* Stop the parsing of the media
*
* When the media parsing is stopped, the libvlc_MediaParsedChanged event will
* be sent with the libvlc_media_parsed_status_timeout status.
*
* \see libvlc_media_parse_with_options
*
* \param p_md media descriptor object
* \version LibVLC 3.0.0 or later
*/
LIBVLC_API void
libvlc_media_parse_stop( libvlc_media_t *p_md );
/**
* Get Parsed status for media descriptor object.
*
......
......@@ -148,6 +148,7 @@ libvlc_media_new_from_input_item
libvlc_media_parse
libvlc_media_parse_async
libvlc_media_parse_with_options
libvlc_media_parse_stop
libvlc_media_player_add_slave
libvlc_media_player_can_pause
libvlc_media_player_program_scrambled
......
......@@ -533,8 +533,7 @@ void libvlc_media_release( libvlc_media_t *p_md )
uninstall_input_item_observer( p_md );
/* Cancel asynchronous parsing (if any) */
if( p_md->p_input_item )
libvlc_MetadataCancel( p_md->p_libvlc_instance->p_libvlc_int, p_md );
libvlc_MetadataCancel( p_md->p_libvlc_instance->p_libvlc_int, p_md );
if( p_md->p_subitems )
libvlc_media_list_release( p_md->p_subitems );
......@@ -818,6 +817,12 @@ libvlc_media_parse_with_options( libvlc_media_t *media,
return media_parse( media, true, parse_flag, timeout ) == VLC_SUCCESS ? 0 : -1;
}
void
libvlc_media_parse_stop( libvlc_media_t *media )
{
libvlc_MetadataCancel( media->p_libvlc_instance->p_libvlc_int, media );
}
/**************************************************************************
* Get parsed status for media object.
**************************************************************************/
......
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