[vlc-devel] [PATCH 03/15] preparser: don't send vlc_InputItemPreparsedChanged in case of failure
Thomas Guillem
thomas at gllm.fr
Thu Apr 14 17:44:52 CEST 2016
The vlc_InputItemPreparseEnded event should be enough.
There is a compat code inside libvlc in order to don't break old API that are
waiting for a libvlc_MediaParsedChanged, even in case of error.
---
lib/media.c | 5 +++++
src/playlist/preparser.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/lib/media.c b/lib/media.c
index e0a5423..f3259ea 100644
--- a/lib/media.c
+++ b/lib/media.c
@@ -265,6 +265,11 @@ static void input_item_preparse_ended( const vlc_event_t * p_event,
libvlc_media_list_internal_end_reached( p_subitems );
libvlc_media_list_unlock( p_subitems );
}
+
+ /* XXX: libVLC 2.2.0 compat: even if case of preparse failure,
+ * libvlc_MediaParsedChanged was sent with a true status. Therefore, send
+ * this event if it was not previously sent */
+ send_preparsed_event(p_md);
}
/**************************************************************************
diff --git a/src/playlist/preparser.c b/src/playlist/preparser.c
index 2870875..e0f6aa8 100644
--- a/src/playlist/preparser.c
+++ b/src/playlist/preparser.c
@@ -201,9 +201,9 @@ static void Preparse( playlist_preparser_t *preparser, input_item_t *p_item,
input_Close( input );
var_SetAddress( preparser->object, "item-change", p_item );
+ input_item_SetPreparsed( p_item, true );
}
- input_item_SetPreparsed( p_item, true );
input_item_SignalPreparseEnded( p_item );
}
--
2.8.0.rc3
More information about the vlc-devel
mailing list