<html><head></head><body>I don't think the pointer itself should be writable. You may want an array of one element, or a constant pointer.<br><br><div class="gmail_quote">Le 1 mars 2019 13:41:50 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">A special block that will be used by audio filters.<hr> include/vlc_block.h | 11 +++++++++++<br> src/libvlccore.sym | 1 +<br> src/misc/block.c | 8 +++++++-<br> 3 files changed, 19 insertions(+), 1 deletion(-)<br><br>diff --git a/include/vlc_block.h b/include/vlc_block.h<br>index 18e1e11514..f4afa0b542 100644<br>--- a/include/vlc_block.h<br>+++ b/include/vlc_block.h<br>@@ -40,6 +40,7 @@<br> * Data block definition and functions<br> */<br> <br>+#include <assert.h><br> #include <sys/types.h> /* for ssize_t */<br> <br> /****************************************************************************<br>@@ -130,6 +131,14 @@ struct block_t<br> const struct vlc_block_callbacks *cbs;<br> };<br> <br>+/**<br>+ * Special block to signal a discontinuity<br>+ *<br>+ * This block needs a special handling: it should not be released or appended<br>+ * to a block chain.<br>+ */<br>+VLC_API block_t *vlc_block_discontinuity;<br>+<br> /**<br> * Initializes a custom block.<br> *<br>@@ -329,6 +338,7 @@ static inline void block_Cleanup (void *block)<br> ****************************************************************************/<br> static inline void block_ChainAppend( block_t **pp_list, block_t *p_block )<br> {<br>+ assert(p_block != vlc_block_discontinuity);<br> if( *pp_list == NULL )<br> {<br> *pp_list = p_block;<br>@@ -344,6 +354,7 @@ static inline void block_ChainAppend( block_t **pp_list, block_t *p_block )<br> <br> static inline void block_ChainLastAppend( block_t ***ppp_last, block_t *p_block )<br> {<br>+ assert(p_block != vlc_block_discontinuity);<br> block_t *p_last = p_block;<br> <br> **ppp_last = p_block;<br>diff --git a/src/libvlccore.sym b/src/libvlccore.sym<br>index a861c988e5..45af83a0fe 100644<br>--- a/src/libvlccore.sym<br>+++ b/src/libvlccore.sym<br>@@ -28,6 +28,7 @@ aout_FiltersDrain<br> aout_FiltersFlush<br> aout_FiltersPlay<br> aout_FiltersAdjustResampling<br>+vlc_block_discontinuity<br> block_Alloc<br> block_FifoCount<br> block_FifoEmpty<br>diff --git a/src/misc/block.c b/src/misc/block.c<br>index 7d67138768..443757e967 100644<br>--- a/src/misc/block.c<br>+++ b/src/misc/block.c<br>@@ -26,7 +26,6 @@<br> #endif<br> <br> #include <sys/stat.h><br>-#include <assert.h><br> #include <errno.h><br> #include <unistd.h><br> #include <fcntl.h><br>@@ -35,11 +34,18 @@<br> #include <vlc_block.h><br> #include <vlc_fs.h><br> <br>+static block_t static_discontinuity_block =<br>+{<br>+ .i_flags = BLOCK_FLAG_DISCONTINUITY,<br>+};<br>+block_t *vlc_block_discontinuity = &static_discontinuity_block;<br>+<br> #ifndef NDEBUG<br> static void block_Check (block_t *block)<br> {<br> while (block != NULL)<br> {<br>+ assert(block != vlc_block_discontinuity);<br> unsigned char *start = block->p_start;<br> unsigned char *end = block->p_start + block->i_size;<br> unsigned char *bufstart = block->p_buffer;</pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>