<html><head></head><body>Hi,<br><br>This would work properly if demuxers never modified the configuration, or texl'heir parent objects, etc. But because some of them do (AFAIR), this leaks unreproducible state into the testing.<br><br>Which would somewhat obviously be a very bad thing.<br><br><div class="gmail_quote">Le 20 février 2019 19:40:07 GMT+02:00, Thomas Guillem <thomas@gllm.fr> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">Same than vlc_demux_process_memory but with a libvlc_instance_t arg.<hr> test/src/input/demux-run.c | 19 +++++++++++++------<br> test/src/input/demux-run.h |  3 +++<br> 2 files changed, 16 insertions(+), 6 deletions(-)<br><br>diff --git a/test/src/input/demux-run.c b/test/src/input/demux-run.c<br>index fe9ce530b5..8178756ed6 100644<br>--- a/test/src/input/demux-run.c<br>+++ b/test/src/input/demux-run.c<br>@@ -363,6 +363,18 @@ int vlc_demux_process_path(const struct vlc_run_args *args, const char *path)<br>     return ret;<br> }<br> <br>+int libvlc_demux_process_memory(libvlc_instance_t *vlc,<br>+                                const struct vlc_run_args *args,<br>+                                const unsigned char *buf, size_t length)<br>+{<br>+    stream_t *s = vlc_stream_MemoryNew(VLC_OBJECT(vlc->p_libvlc_int),<br>+                                       (void *)buf, length, true);<br>+    if (s == NULL)<br>+        fprintf(stderr, "Error: cannot create input stream\n");<br>+<br>+    return demux_process_stream(args, s);<br>+}<br>+<br> int vlc_demux_process_memory(const struct vlc_run_args *args,<br>                              const unsigned char *buf, size_t length)<br> {<br>@@ -370,12 +382,7 @@ int vlc_demux_process_memory(const struct vlc_run_args *args,<br>     if (vlc == NULL)<br>         return -1;<br> <br>-    stream_t *s = vlc_stream_MemoryNew(VLC_OBJECT(vlc->p_libvlc_int),<br>-                                       (void *)buf, length, true);<br>-    if (s == NULL)<br>-        fprintf(stderr, "Error: cannot create input stream\n");<br>-<br>-    int ret = demux_process_stream(args, s);<br>+    int ret = libvlc_demux_process_memory(vlc, args, buf, length);<br>     libvlc_release(vlc);<br>     return ret;<br> }<br>diff --git a/test/src/input/demux-run.h b/test/src/input/demux-run.h<br>index 01ae245891..551f002770 100644<br>--- a/test/src/input/demux-run.h<br>+++ b/test/src/input/demux-run.h<br>@@ -30,3 +30,6 @@ int vlc_demux_process_url(const struct vlc_run_args *, const char *url);<br> int vlc_demux_process_path(const struct vlc_run_args *, const char *path);<br> int vlc_demux_process_memory(const struct vlc_run_args *,<br>                              const unsigned char *buf, size_t length);<br>+int libvlc_demux_process_memory(libvlc_instance_t *vlc,<br>+                                const struct vlc_run_args *args,<br>+                                const unsigned char *buf, size_t length);</pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>