Commit 8adbb2d7 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

libvlc: Don't refer to media_preparsing as we don't have media_parsing.

parsing is simpler.
parent 8211292f
...@@ -49,7 +49,7 @@ enum libvlc_event_e { ...@@ -49,7 +49,7 @@ enum libvlc_event_e {
libvlc_MediaMetaChanged=0, libvlc_MediaMetaChanged=0,
libvlc_MediaSubItemAdded, libvlc_MediaSubItemAdded,
libvlc_MediaDurationChanged, libvlc_MediaDurationChanged,
libvlc_MediaPreparsedChanged, libvlc_MediaParsedChanged,
libvlc_MediaFreed, libvlc_MediaFreed,
libvlc_MediaStateChanged, libvlc_MediaStateChanged,
...@@ -127,7 +127,7 @@ typedef struct libvlc_event_t ...@@ -127,7 +127,7 @@ typedef struct libvlc_event_t
struct struct
{ {
int new_status; int new_status;
} media_preparsed_changed; } media_parsed_changed;
struct struct
{ {
libvlc_media_t * md; libvlc_media_t * md;
......
...@@ -398,12 +398,12 @@ libvlc_media_parse(libvlc_media_t *media); ...@@ -398,12 +398,12 @@ libvlc_media_parse(libvlc_media_t *media);
* This fetches (local) meta data and tracks information. * This fetches (local) meta data and tracks information.
* The method is the asynchronous of libvlc_media_parse_async(). * The method is the asynchronous of libvlc_media_parse_async().
* *
* To track when this is over you can listen to libvlc_MediaPreparsedChanged * To track when this is over you can listen to libvlc_MediaParsedChanged
* event. However if the media was already preparsed you will not receive this * event. However if the media was already parsed you will not receive this
* event. * event.
* *
* \see libvlc_media_parse * \see libvlc_media_parse
* \see libvlc_MediaPreparsedChanged * \see libvlc_MediaParsedChanged
* \see libvlc_media_get_meta * \see libvlc_media_get_meta
* \see libvlc_media_get_tracks_info * \see libvlc_media_get_tracks_info
* *
...@@ -413,13 +413,15 @@ VLC_PUBLIC_API void ...@@ -413,13 +413,15 @@ VLC_PUBLIC_API void
libvlc_media_parse_async(libvlc_media_t *media); libvlc_media_parse_async(libvlc_media_t *media);
/** /**
* Get preparsed status for media descriptor object. * Get Parsed status for media descriptor object.
*
* \see libvlc_MediaParsedChanged
* *
* \param p_md media descriptor object * \param p_md media descriptor object
* \return true if media object has been preparsed otherwise it returns false * \return true if media object has been parsed otherwise it returns false
*/ */
VLC_PUBLIC_API int VLC_PUBLIC_API int
libvlc_media_is_preparsed( libvlc_media_t * p_md ); libvlc_media_is_parsed( libvlc_media_t * p_md );
/** /**
* Sets media descriptor's user_data. user_data is specialized data * Sets media descriptor's user_data. user_data is specialized data
......
...@@ -252,7 +252,7 @@ static const event_name_t event_list[] = { ...@@ -252,7 +252,7 @@ static const event_name_t event_list[] = {
DEF(MediaMetaChanged) DEF(MediaMetaChanged)
DEF(MediaSubItemAdded) DEF(MediaSubItemAdded)
DEF(MediaDurationChanged) DEF(MediaDurationChanged)
DEF(MediaPreparsedChanged) DEF(MediaParsedChanged)
DEF(MediaFreed) DEF(MediaFreed)
DEF(MediaStateChanged) DEF(MediaStateChanged)
......
...@@ -172,8 +172,8 @@ static void input_item_preparsed_changed(const vlc_event_t *p_event, ...@@ -172,8 +172,8 @@ static void input_item_preparsed_changed(const vlc_event_t *p_event,
/* Construct the event */ /* Construct the event */
event.type = libvlc_MediaPreparsedChanged; event.type = libvlc_MediaParsedChanged;
event.u.media_preparsed_changed.new_status = event.u.media_parsed_changed.new_status =
p_event->u.input_item_preparsed_changed.new_status; p_event->u.input_item_preparsed_changed.new_status;
/* Send the event */ /* Send the event */
...@@ -284,18 +284,14 @@ libvlc_media_t * libvlc_media_new_from_input_item( ...@@ -284,18 +284,14 @@ libvlc_media_t * libvlc_media_new_from_input_item(
free(p_md); free(p_md);
return NULL; return NULL;
} }
libvlc_event_manager_register_event_type( p_md->p_event_manager,
libvlc_MediaMetaChanged ); libvlc_event_manager_t *em = p_md->p_event_manager;
libvlc_event_manager_register_event_type( p_md->p_event_manager, libvlc_event_manager_register_event_type(em, libvlc_MediaMetaChanged);
libvlc_MediaSubItemAdded ); libvlc_event_manager_register_event_type(em, libvlc_MediaSubItemAdded);
libvlc_event_manager_register_event_type( p_md->p_event_manager, libvlc_event_manager_register_event_type(em, libvlc_MediaFreed);
libvlc_MediaFreed ); libvlc_event_manager_register_event_type(em, libvlc_MediaDurationChanged);
libvlc_event_manager_register_event_type( p_md->p_event_manager, libvlc_event_manager_register_event_type(em, libvlc_MediaStateChanged);
libvlc_MediaDurationChanged ); libvlc_event_manager_register_event_type(em, libvlc_MediaParsedChanged);
libvlc_event_manager_register_event_type( p_md->p_event_manager,
libvlc_MediaStateChanged );
libvlc_event_manager_register_event_type( p_md->p_event_manager,
libvlc_MediaPreparsedChanged );
vlc_gc_incref( p_md->p_input_item ); vlc_gc_incref( p_md->p_input_item );
...@@ -641,10 +637,10 @@ libvlc_media_parse_async(libvlc_media_t *media) ...@@ -641,10 +637,10 @@ libvlc_media_parse_async(libvlc_media_t *media)
} }
/************************************************************************** /**************************************************************************
* Get preparsed status for media object. * Get parsed status for media object.
**************************************************************************/ **************************************************************************/
int int
libvlc_media_is_preparsed( libvlc_media_t * p_md ) libvlc_media_is_parsed( libvlc_media_t * p_md )
{ {
assert( p_md ); assert( p_md );
......
...@@ -47,7 +47,7 @@ static void test_media_preparsed(const char** argv, int argc) ...@@ -47,7 +47,7 @@ static void test_media_preparsed(const char** argv, int argc)
// Check to see if we are properly receiving the event. // Check to see if we are properly receiving the event.
libvlc_event_manager_t *em = libvlc_media_event_manager (media); libvlc_event_manager_t *em = libvlc_media_event_manager (media);
libvlc_event_attach (em, libvlc_MediaPreparsedChanged, preparsed_changed, (void*)&received); libvlc_event_attach (em, libvlc_MediaParsedChanged, preparsed_changed, (void*)&received);
// Parse the media. This is synchronous. // Parse the media. This is synchronous.
libvlc_media_parse(media); libvlc_media_parse(media);
...@@ -57,7 +57,7 @@ static void test_media_preparsed(const char** argv, int argc) ...@@ -57,7 +57,7 @@ static void test_media_preparsed(const char** argv, int argc)
// We are good, now check Elementary Stream info. // We are good, now check Elementary Stream info.
libvlc_media_track_info_t *tracks; libvlc_media_track_info_t *tracks;
int num = libvlc_media_get_es(media, &tracks); int num = libvlc_media_get_tracks_info(media, &tracks);
assert(num > 0); assert(num > 0);
free(tracks); free(tracks);
......
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