<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<title></title>
<style type="text/css">code{white-space: pre;}</style>
</head>
<body>
<p>Hi,</p>
<p>Attached to this email is an <code>mbox</code> that contains the revised patches related to the <a href="https://mailman.videolan.org/pipermail/vlc-devel/2017-March/112232.html">previously submitted patch-batch</a>.</p>
<p>Best Regards,<br />
Filip</p>
<hr style="height:1px;margin-bottom:20px;background-color:#ddd;color:#ddd" />
<h3 id="summary">Summary</h3>
<p>As the changes are relatively minor I will outline the changes in this email instead of fully resubmitting all of the patches where most patches are only affected by a single line-change:</p>
<ul>
<li><p>The declaration for <code>vlc_stream_NewMRL</code> has been moved from <code>include/vlc_stream.h</code> to <code>include/vlc_stream_extractor.h</code> to prevent people from “accidentally” using the function due to ignorance.</p></li>
<li>The documentation for <code>vlc_stream_NewMRL</code> has been rewritten:</li>
<li>The summary-line has been shortened.</li>
<li><p>The wording has changed in an attempt to be more explicit about when <code>vlc_stream_NewMRL</code> is required compared to <code>vlc_strean_NewURL</code>.</p></li>
<li><p>The documentation for the internal function <code>stream_extractor_AttachParsed</code> has been revised to fit better in the doxygen format.</p></li>
<li><p>A slight error has been corrected in <code>vlc_stream_NewMRL</code> that leaked allocated resource on error.</p></li>
<li><p>Usage of <code>vlc_stream_NewMRL</code> now requires include of <code>include/vlc_stream_extractor.h</code>, and the affected patches has been updated.</p></li>
</ul>
<p>The patch-batch in its current state is currently available at the <a href="https://github.com/FilipRoseen-refp/vlc/commits/stream_extractor-MRL">relevant branch</a> on my public github repo.</p>
<hr style="height:1px;margin-bottom:20px;background-color:#ddd;color:#ddd" />
<h3 id="diff-related-to-changes"><em>diff</em> related to changes</h3>
<p>Below is the <em>diff</em> between the previous submission, and the updated one (for those who prefer viewing cold hard diffs instead of reading the previous stated summary).</p>
<pre><code>diff --git a/include/vlc_stream.h b/include/vlc_stream.h
index 8341c8a19f..a2a84065f8 100644
--- a/include/vlc_stream.h
+++ b/include/vlc_stream.h
@@ -366,22 +366,6 @@ VLC_USED;
#define vlc_stream_NewURL(a, b) vlc_stream_NewURL(VLC_OBJECT(a), b)
/**
- * Create a stream_t reading from a \ref MRL.
- * You must delete it using vlc_stream_Delete.
- *
- * \warning This function shall only be used when MRL functionality is
- * explicitly needed (such as when referring to items within an
- * archive). \ref vlc_stream_NewURL shall be used where applicable.
- *
- * \param obj the parent of the requested stream
- * \param mrl the mrl for which the stream_t should be created
- * \return NULL on error, pointer to stream_t on success
- */
-VLC_API stream_t * vlc_stream_NewMRL(vlc_object_t *obj, const char *mrl)
-VLC_USED;
-#define vlc_stream_NewMRL(a, b) vlc_stream_NewMRL(VLC_OBJECT(a), b)
-
-/**
* \defgroup stream_fifo FIFO stream
* In-memory anonymous pipe
@{
diff --git a/include/vlc_stream_extractor.h b/include/vlc_stream_extractor.h
index bc90879016..45c46d566d 100644
--- a/include/vlc_stream_extractor.h
+++ b/include/vlc_stream_extractor.h
@@ -90,6 +90,29 @@ typedef struct stream_directory_t {
} stream_directory_t;
/**
+ * Create a stream for the data referred to by a \ref mrl
+ *
+ * This function will create a \ref stream that reads from the specified \ref
+ * mrl, potentially making use of \ref stream_extractor%s to access named
+ * entities within the data read from the original source.
+ *
+ * - See the \ref mrl specification for further information.
+ * - The returned resource shall be deleted through \ref vlc_stream_Delete.
+ *
+ * \warning This function is only be used when \ref mrl functionality is
+ * explicitly needed, \ref vlc_stream_NewURL shall be used where
+ * applicable (and functionality associated with \ref MRL is not
+ * wanted nor needed).
+ *
+ * \param obj the owner of the requested stream
+ * \param mrl the mrl for which the stream_t should be created
+ * \return `NULL` on error, a pointer to \ref stream_t on success.
+ **/
+VLC_API stream_t * vlc_stream_NewMRL(vlc_object_t *obj, const char *mrl)
+VLC_USED;
+#define vlc_stream_NewMRL(a, b) vlc_stream_NewMRL(VLC_OBJECT(a), b)
+
+/**
* Create a relative MRL for the associated entity
*
* This function shall be used by stream_directory_t's in order to
diff --git a/modules/misc/addons/fsstorage.c b/modules/misc/addons/fsstorage.c
index 6da5f28319..d9133e4ad3 100644
--- a/modules/misc/addons/fsstorage.c
+++ b/modules/misc/addons/fsstorage.c
@@ -30,6 +30,7 @@
#include <vlc_plugin.h>
#include <vlc_modules.h>
#include <vlc_stream.h>
+#include <vlc_stream_extractor.h>
#include <vlc_addons.h>
#include <vlc_fs.h>
#include <vlc_strings.h>
diff --git a/modules/misc/addons/vorepository.c b/modules/misc/addons/vorepository.c
index f2cd6ee383..375a1a6ee6 100644
--- a/modules/misc/addons/vorepository.c
+++ b/modules/misc/addons/vorepository.c
@@ -29,6 +29,7 @@
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_stream.h>
+#include <vlc_stream_extractor.h>
#include <vlc_addons.h>
#include <vlc_xml.h>
#include <vlc_fs.h>
diff --git a/src/input/stream.c b/src/input/stream.c
index 063daa4c95..6045f53cee 100644
--- a/src/input/stream.c
+++ b/src/input/stream.c
@@ -145,12 +145,13 @@ stream_t *(vlc_stream_NewMRL)(vlc_object_t* parent, const char* mrl )
char const* anchor = strchr( mrl, '#' );
if( anchor == NULL )
- anchor = "#";
+ return stream;
char const* extra;
if( stream_extractor_AttachParsed( &stream, anchor + 1, &extra ) )
{
msg_Err( parent, "unable to open %s", mrl );
+ vlc_stream_Delete( stream );
return NULL;
}
diff --git a/src/input/stream.h b/src/input/stream.h
index 2f5ca8b9b7..97d1957b26 100644
--- a/src/input/stream.h
+++ b/src/input/stream.h
@@ -54,8 +54,11 @@ stream_t *stream_FilterAutoNew( stream_t *source ) VLC_USED;
stream_t *stream_FilterChainNew( stream_t *p_source, const char *psz_chain );
/**
- * This function will parse the passed data, and try to attach
- * stream-extractors for each specified entity as per \ref mrl,
+ * Attach \ref stream_extractor%s according to specified data
+ *
+ * This function will parse the passed data, and try to attach a \ref
+ * stream_extractor for each specified entity as per the fragment specification
+ * associated with a \ref mrl,
*
* \warning The data in `*stream` can be modified even if this function only
* locates some of the entities specified in `psz_data`. It is up to</code></pre>
</body>
</html>