[vlc-devel] [PATCH] input: Delete the demux_filter chain upon input deletion

Rémi Denis-Courmont remi at remlab.net
Fri Jun 23 11:54:21 CEST 2017

Le 23 juin 2017 10:53:21 GMT+02:00, "Hugo Beauzée-Luyssen" <hugo at beauzee.fr> a écrit :
>On Thu, Jun 22, 2017, at 06:10 PM, Rémi Denis-Courmont wrote:
>> On jeudi 22 juin 2017 17:37:44 EEST Hugo Beauzée-Luyssen wrote:
>> > This allows a demux_filter to be removed from the chain without
>> > removing the entire chain at once.
>> TBH, I don't see the point. After the filter is removed, the input
>> knows 
>> nothing of the original demux anymore (just like it knows nothing of
>> stream filters and access). So the only sane thing to do is to delete
>> and 
>> any intermediate filters.
>As far as I understand that's not an issue, when we insert a
>demux_filter we prepend it to the chain, so removing it shouldn't
>the remaining demux/stream_filter/access
>It's also possible to destroy the chain entirely, and call
>InputSourceNew again to recreate the entire chain, but it feels
>needlessly heavy, and seems problematic for non-seekable input for
>> Also the capability check is very ugly.
>True, the other way to do the same I can see would be to check if
>psz_access/demux/location/file are all set to NULL, but I find this
>explicit at best (and is it a valid assumption?). We could add a small
>helper though.
>> -- 
>> Rémi
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
>  Hugo Beauzée-Luyssen
>  hugo at beauzee.fr
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:

That does not seem right. Unless the demux filter is basically just a useless pass-through filter, the state of the demux on the interface between the input thread and the demux filter won't match the state of the demux on the interface between the real demux and the demux filter.

So you can't just remove the filter and hope things will keep working. Even less so whence the demux filter gets a sane implementation allowing to filter the ES output in addition to demux controls.

Generally, you can't susbtitute a stateful object with another one, even if they are of the same class.
Rémi Denis-Courmont
Typed on an inconvenient virtual keyboard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20170623/46031d02/attachment.html>

More information about the vlc-devel mailing list