If we are unable to exit the current source-stream (be that for
whatever reason), we should not ignore the error as it /may/ have
fatal consequences down the road.
Better safe than sorry.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
The same check is correctly implemented in archive.c:DirectoryOpen,
but is missing from ExtractorOpen - resulting in a null-pointer
dereference if a libarchive handle fails to be created.
fixes: #18133
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
If the libarchive_exit_cb is called due to clean-up (because we are
dead), there is no point in seeking back to zero. It might even fail
if our source module reacts to vlc_killed (such as
stream_filter/cache_read).
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
There are paths that can be skipped if we are closing down the module,
and some should even be explicitly avoided.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Given that p_sys->p_obj is yet to be initialized with the value of the
obj, the implementation should use the latter (given that the former
will be zero-initialized, but nothing more).
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
These changes introduces a new module type named stream_extractor. The
added documentation should explain when such module should be used,
but in short it allows for extraction of data within a stream,
effectively resulting in a new stream that refers to the extracted
data.
Interaction with the stream-extractor shall never happen directly,
instead the module-backend is written in a way so that it exposes a
stream_t to the public.
[ access ] -> [ stream_t ] -> [ stream consumer ]
'- [ stream extractor ]
Future changes are necessary in order to make modules of this type
usable in practice, but has been split into individual commits so that
the changes are easier to follow.
Signed-off-by: Thomas Guillem <thomas@gllm.fr>