[vlc-commits] stream_filter: only filter byte streams

Rémi Denis-Courmont git at videolan.org
Fri Sep 25 20:57:49 CEST 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Sep 24 20:04:42 2020 +0300| [60e36ce7d25f1badc3bd14931195a99c5afe1767] | committer: Rémi Denis-Courmont

stream_filter: only filter byte streams

All existing stream filters either implicitly (e.g. by peeking) or
explicitly (by checking pf_* pointers) check that the source is a byte
stream.

Don't waste time probing filters for directories or (access_)demuxers.
If we ever need to filter directories, we are better off adding a
different capability to do so.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=60e36ce7d25f1badc3bd14931195a99c5afe1767
---

 src/input/stream_filter.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/input/stream_filter.c b/src/input/stream_filter.c
index 7b190a3739..40ccbeaf82 100644
--- a/src/input/stream_filter.c
+++ b/src/input/stream_filter.c
@@ -52,6 +52,10 @@ stream_t *vlc_stream_FilterNew( stream_t *p_source,
 {
     assert(p_source != NULL);
 
+    /* Stream filters can only filter byte streams. */
+    if (p_source->pf_read == NULL && p_source->pf_block == NULL)
+        return NULL;
+
     struct vlc_stream_filter_private *priv;
     stream_t *s = vlc_stream_CustomNew(vlc_object_parent(p_source),
                                        StreamDelete, sizeof (*priv),



More information about the vlc-commits mailing list