1
mirror of https://code.videolan.org/videolan/vlc synced 2024-09-04 09:11:33 +02:00
Commit Graph

33 Commits

Author SHA1 Message Date
Lyndon Brown
6f68f89498 plugins: purge use of set_category()
see e967f81f6a.

note, this does **not** affect cat-based module selection items
(of which there are just three in use by the core), since that
mechanism uses subcats not cats.
2021-12-20 09:45:01 +00:00
LE QUEC Nicolas
bcc79fbfc3 archive: get mtime and size of the item
Refs #25747
2021-12-10 08:53:41 +00:00
LE QUEC Nicolas
97a09be754 item: add created_item field in vlc_readdir_helper_additem function
In the access modules, we would like to be able to send file properties such as size directly
to the input item. But no reference to this item is accessible.
This field will allow you to retrieve the item created by the function.
2021-12-10 08:53:41 +00:00
Johan Gunnarsson
059f6f5690 archive: Add support for RAR 5.0 format
libarchive 3.4.0 adds support for RAR 5.0. See
https://www.rarlab.com/technote.htm#rarsign for description of signatures.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2019-11-03 11:39:45 +01:00
Steve Lhomme
5363279805 remove the $Id$ in the source code 2019-01-17 12:21:18 +01:00
Filip Roséen
51824f14fd stream_extractor: archive: enable Control/Seek even if libarchive died
As we might be able to recover from a libarchive fatal error (by
resetting the handle to an appropriate state), there is no need for us
to disable controls completely.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2018-07-26 00:11:54 +02:00
Filip Roséen
3ecbbfac7d stream_extractor: archive: simplify seeking
As a seek should be successful even if the requested position is
outside the bounds of the input, there is no need for us to reset the
state of the libarchive reader immediately after seeking fails,
instead we rely on the fact that future reads will return EOF, and
that the reader will have to seek to a proper position in order to
continue reading (causing a libarchive reset).

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2018-07-26 00:11:50 +02:00
Filip Roséen
3844aeab7e stream_extractor: archive: kill archive on reset error
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2018-07-26 00:11:16 +02:00
Filip Roséen
072c3e6368 stream_extractor: archive: explicitly handle EOF
Things will be a lot simpler if we explicitly handle EOF different
from a libarchive error.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2018-07-26 00:11:09 +02:00
Filip Roséen
5d3f5afc24 stream_extractor: archive: do not try to seek beyond entry size
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2018-07-24 15:40:53 +02:00
Filip Roséen
04e6b7a226 stream_extractor: archive: fail STREAM_GET_SIZE if size is unavailable
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2018-07-24 15:40:53 +02:00
Filip Roséen
472a05119d stream_extractor: archive: remove redundant variable
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2018-07-24 15:40:53 +02:00
Filip Roséen
9399f255e7 stream_extractor: archive: reset position on failed seek
The previous implementation would not reset the read position if
someone tried to seek outside the current buffer, causing the module
to signal EOF on subsequent reads, which is of course false.

These changes makes sure that we do our best to reset back to the
original position, preventing a premature EOF.

Close #20540

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2018-07-24 15:40:53 +02:00
Filip Roséen
6062e012d8 stream_extractor: archive: add archive_extractor_reset
In order for us to start over, such as a failed attempt of
dumb-seeking, we must reset the state of our extractor as if we just
opened the file.

This helper accomplishes that while also making sure that all
associated variables are back in a proper state.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2018-07-24 15:40:53 +02:00
Filip Roséen
7320589137 stream_extractor: archive: add archive_skip_decompressed
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2018-07-24 15:40:53 +02:00
Filip Roséen
f53d05b958 stream_extractor: archive: fix spelling in comment
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2018-07-24 15:40:53 +02:00
Filip Roséen
67e41b01dc stream_extractor: archive: silence warning about fall-through
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2018-07-24 15:40:53 +02:00
Marvin Scholz
55c3009525 stream_extractor/archive: use correct format specifier for ssize_t
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2018-03-29 18:16:08 +03:00
Marvin Scholz
0953abb417 stream_extractor/archive: Check for NULL return of archive_entry_pathname
Fixes CD 2a1e0ab3-e9d5-433c-afd8-ec56e6a8968f
2018-01-05 20:45:14 +01:00
Pierre Lamot
777514b42f se/archive: fix seeking with SEEK_END
Fixes #19133

Signed-off-by: Thomas Guillem <thomas@gllm.fr>
2017-12-01 17:27:33 +01:00
Thomas Guillem
a913906b13 se/archive: use readdir_helper 2017-09-20 17:37:22 +02:00
Filip Roséen
66c88b4da2 se/archive: prevent potential call to archive_{entry, read}_free with NULL
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2017-03-17 19:09:22 +01:00
Filip Roséen
4b325ac0f4 se/archive: issue diagnostic on reset failure
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2017-03-17 19:09:04 +01:00
Filip Roséen
14cc6cff08 se/archive: protect paths relying on p_sys->p_entry != NULL
The following paths will stumble into undefined-behavior land if
p_sys->p_entry is NULL.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2017-03-17 19:08:54 +01:00
Filip Roséen
1d1d8f15a6 se/archive: add missing error-check in jump-callback
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>
2017-03-17 19:04:06 +01:00
Filip Roséen
4a9c32e0a2 se/archive: ExtractorOpen: add missing error-check in open
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>
2017-03-17 19:04:06 +01:00
Filip Roséen
00951ad009 se/archive: do not reset source position if dead
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>
2017-03-17 19:02:39 +01:00
Filip Roséen
65c9f5e8d3 se/archive: set b_dead = true on Close
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>
2017-03-17 19:02:39 +01:00
Steve Lhomme
d532f07382 stream_extractor: fix compilation with older libarchive
Since we require only 3.1.0 instead of 3.2.2 in the contribs

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2017-03-03 15:16:53 +01:00
Hugo Beauzée-Luyssen
60d6dc700e archive: Fix leak on error
CID #1413318
2017-02-27 12:01:43 +01:00
Filip Roséen
c3c3d670a1 stream_extractor/archive: prevent null-pointer dereference
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>
2017-02-24 00:22:48 +01:00
Filip Roséen
6a88437966 modules/stream_extractor: add libarchive extractor
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2017-02-21 15:29:59 +01:00
Filip Roséen
3c20a6c377 core: add stream_extractor module type
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>
2016-12-06 15:57:19 +01:00