This commit moves the remaining callbacks of stream/demux: pf_read/
pf_block/pf_seek/pf_readdir and pf_demux into their operations table,
aiming at unifying all the callbacks under a unique place.
This is a follow-up to the introduction of typed controls callbacks
for stream and demux.
Like for the typed controls callbacks if no operation is provided
(ie, stream_t/demux_t.ops is NULL) by a module, the legacy pf_* will be
used instead as a fallback.
The commit doesn't migrate any of modules yet.
When the input is stopped or an error occurred, the capabilities
should reflect that, so that on_capabilities_changed is invoked
as expected.
Fix#27047
It is not used in POSIX systems. On other system it probably don't make a
difference anymore, only Windows has actual useful values for
VLC_THREAD_PRIORITY_XXX. The synchronization is more important than having some
threads called more often than others.
Fix a leak happening when an input slave fails to load.
Leak detected with asan:
```
Direct leak of 120 byte(s) in 1 object(s) allocated from:
#0 0x7f56cb985ad7 in calloc (/lib64/libasan.so.6)
#1 0x7f56cad22849 in InputSourceNew src/input/input.c:2605
#2 0x7f56cad2c9ca in input_SlaveSourceAdd src/input/input.c:3408
#3 0x7f56cad0f838 in LoadSlaves src/input/input.c:1164
#4 0x7f56cad1219a in Init src/input/input.c:1360
#5 0x7f56cad06092 in Run src/input/input.c:466
#6 0x7f56c9998b19 in start_thread (/lib64/libc.so.6)
```
Rename it to input_type, expose it via input_internal.h (usable by
input.c / es_out.c), and pass it to es_out in order to avoid fetching
input_thread_t private data.
Fix a regression introduced by bbdaa0b64a
where some access MRL would, by design, make the url parsing fail.
Url parsing failing should not be a blocker to add the input slave,
instead we just warn the user that we couldn't deduce the slave file
type based on the given MRL.
Fixes#26055
Historically, only local slaves or one added via the "input-slave" are
automatically selected. This commit adds autoselection for slaves found
by a network directory demuxer. To avoid false positives, only perfectly
matched slaves are auto-selected.
There is still a difference between local and network slaves:
- Any matched local slaves will be auto-selected
- Only perfectly matched network slaves will be auto-selected
Fixes#25673
InputSourceInit() is called to initialize the master and all slaves
inputs. Some initialisation concerned only the master, so move them out to a
new function: InitProperties().
This fixes the input slaves overriding some item properties
(attachment) and the master capabilities.
Move the option parsing right before the input-item slaves copy. This
avoid input-slaves unnecessary duplication each time the input is
reparsed as the input-item slaves copy itself avoid duplicating.
Fixes#19977
As shown in #25549, we need to extract the path from the url in order to
check the file extension without the eventual HTTP's options noise.
Fixes: #25549
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
Since c34d719f, all files passed by the option `input-slave` were set as
audio tracks no matter what.
Theses changes force subtitle demux on files with a known spu extension.
Fixes#25549
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
This mimicks input_resource_PutVout(), except in the case that the
second parameter is NULL:
- PutVout() asserts that that is not the case.
- PutSout() destroys the resource sout.
It is unclear if this is really intended. If not, this should be
addressed later on (this patch makes no functional changes).