Commit Graph

2091 Commits

Author SHA1 Message Date
Kacper Michajłow a59b8edb96 stream: increase max_size to INT_MAX minus padding
No need to magic number limit, we can support up to INT_MAX with current
code. Which should be more than enough.
2024-01-31 15:38:21 +00:00
llyyr 8fe2af09f1 common: stream: don't mention Libav in errors/warnings 2024-01-20 16:10:20 +00:00
Kacper Michajłow ed107c4116 meson: adjust win32 defines
- Don't define _GNU_SOURCE on Windows, no need
- Define WIN32_LEAN_AND_MEAN to strip some unneded headers from
  windows.h
- Define NOMINMAX and _USE_MATH_DEFINES as they are common for Windows
  headers
2023-11-25 12:38:20 +01:00
Kacper Michajłow 4449f38c17 various: add some missing error checks 2023-11-18 23:55:28 +00:00
Kacper Michajłow 56d35da180 mp_thread: add win32 implementation 2023-11-05 17:36:17 +00:00
Kacper Michajłow 174df99ffa ALL: use new mp_thread abstraction 2023-11-05 17:36:17 +00:00
sfan5 490af95c10 dvbin: do a big cleanup on code style and functions 2023-10-21 11:07:59 +02:00
sfan5 c78c33bf7c stream_dvb: avoid static function variable 2023-10-21 11:07:59 +02:00
sfan5 2569c69d92 dvb_tune: remove use of time() 2023-10-21 11:07:59 +02:00
sfan5 d7683ec4ac dvbin: revise many log lines 2023-10-21 11:07:59 +02:00
sfan5 e8e1466426 stream_dvb: use talloc 2023-10-21 11:07:59 +02:00
sfan5 a394e5cd1d stream_dvb: fix missing newlines on log messages 2023-10-21 11:07:59 +02:00
Dudemanguy 39247bd0b6 stream_cdda: deprecate --cdda-toc-bias and always check for offsets
I started going through the blame but once I got to mplayer commits from
20 years ago, I stopped bothering. This obscure option has always been
disabled by default, but there's zero reason, as far as I know, to not
just enable it today. Some CDs (particularly very old ones) have the
first sector shifted a bit and not starting exactly at 0. This makes the
logic that tries to get all the chapters completely fail and thus you
can't skip through tracks. However if you just enable this obscure
option, it just works. For anything that starts exactly at 0, the
calculated offset is just 0 anyway so it's a no-op and works exactly the
same. So basically, there's literally no reason to not just always try
to correct for the offset of the first sector by default.

Fixes #8777.
2023-10-19 12:10:53 -05:00
Dudemanguy 3504136d3f stream_cdda: remove printing track info in fill_buffer
It was completely wrong. mpv will buffer data ahead of where the CD
currently is playing. When enough data was buffered into the next track,
the track info is printed regardless of where the stream position
actually is. Depending on the user settings, you can get mpv to buffer
minutes ahead. Printing a message when the track changes might be nice,
but this isn't the right place to do it. Some other mechanism would need
to be leveraged, but I'm not going to bother figuring it out.
2023-10-19 12:10:53 -05:00
Dudemanguy d5e5c2ce98 stream_cdda: remove fallback for ancient libcdio versions
CDIO_API_VERSION 6 has been around since libcdio 0.90. That was release
over a decade ago. There's literally no reason to keep the ugly mess of
the old api around so remove it.
2023-10-19 12:10:53 -05:00
Kacper Michajłow 4e6325d012 stream_cdda: suppress -Wstrict-prototypes from cdio 2023-10-19 14:03:23 +00:00
Dudemanguy e22efe2d22 stream_lavf: use metadata-codepage option for codepage conversion
a343666ab5 made demux options public, so
we can take advantage of that here as well. This lets users guess the
codepage if the stream doesn't use UTF-8 characters. Fixes #8844.
2023-10-07 02:41:27 +00:00
Kacper Michajłow cdfd5c280a win32/pthread: define _POSIX_TIMERS to notify they are not supported 2023-09-29 20:48:58 +00:00
Dudemanguy 610faf705b stream: remove unneeded mp_read_option_raw call
We can get the group from demux_conf instead and use that.
2023-09-22 14:20:38 +00:00
Dudemanguy 8a7704ea89 stream_bluray: move --bluray-device to stream_bluray_opts
Similar to the previous commit. There's no reason for --bluray-device to
be in MPOpts. Make a specific subopt for stream_bluray and use that
instead so we can remove the mp_read_option_raw call.
2023-09-22 14:20:38 +00:00
Dudemanguy 6ea9ec9931 stream_cdda: move cdrom-device to cdda_params
There is zero reason for this to be an MPOpt. Because of how the
OPT_SUBSTRACT works, the option gets renamed to cdda-device instead, but
probably not a big deal since the old alias is still in place.
2023-09-22 14:20:38 +00:00
Dudemanguy 969c19c9cb options: remove ancient option fallbacks/deprecation
We've got an ungodly amount of OPT_REPLACED and OPT_REMOVED sitting
around in the code. This is harmless, but the vast majority of these are
ancient. 26f4f18c06 is the last commit
that touched the majority of these and of course that only changed how
options were declared so all of this stuff was deprecated even before
that. No use in keeping these, so just delete them all. As an aside,
there was actually a cocoa_opts but it had only a single option which
was replaced by something else and empty otherwise. So that entire thing
was just simply removed. OPT_REPLACED/OPT_REMOVED declarations that were
added in 0.35 or later were kept as is.
2023-09-21 16:06:29 +00:00
Y0J1G3N 97dc202787 stream: accept dav:// and davs:// urls
The GNOME Nautilus file manager supports browsing of dav:// and davs:// links only. Additionally, dav:// and davs:// are also types of webdav links. Therefore, adding an "or" operation to include support for dav:// and davs:// links.
2023-09-11 18:24:03 +02:00
Oliver Freyermuth 2c8db5af8b stream/dvbin: drop too verbose messages
Echoing channel config format detection for each channel
is a bit too noisy.
2023-09-03 13:08:58 +02:00
Oliver Freyermuth ab2c26ddd2 stream/dvbin: add some helpful verbose output
These verbose messages will help in case adapter detection /
channel list parsing fails.
2023-09-03 13:08:58 +02:00
Oliver Freyermuth 420f92629b stream/dvbin: detect ZAP channel configs looking like VDR configs
While ZAP config files should contain strings in most fields,
their field number in the DVB-T / ISDBT case matches the number of fields
for VDR config files, and some channel list writers (namely, dvbv5-scan)
may insert "0" in unused string fields.
To disentangle such config files from real VDR config files,
add a check for the "INVERSION_" field which should always be filled.
2023-09-03 13:08:58 +02:00
Oliver Freyermuth 7021d095b1 stream/dvbin: do not forget channel list for multiply delivery systems
dvb_get_channels is expected to append to an existing channel list.
For adapters supporting many delivery systems, a subsequent channel list
may turn up with a non-existent channel config, and the pointer
to the previously parsed channel list may be lost
(i.e. the list will be leaked and no channels detected).
Fix this by passing through the existing list (which may be NULL)
in case no new channels are found.
2023-09-03 13:08:58 +02:00
Oliver Freyermuth d88e3d105a stream/dvbin: add support for delivery system ISDB-T
This is similar to DVB-T, but requires slightly different treatment
as there is no T/T2 differentiation.
Use a new channels.conf.isdbt file as channels config file.
2023-09-03 13:08:58 +02:00
Christoph Heinrich c0807e98fb options: remove explicit initialization of integers to 0 2023-02-21 17:15:17 +00:00
Christoph Heinrich 4ebfe9851c options: transition commands from OPT_FLAG to OPT_BOOL 2023-02-21 17:15:17 +00:00
Christoph Heinrich 91cc0d8cf6 options: transition options from OPT_FLAG to OPT_BOOL
c784820454 introduced a bool option type
as a replacement for the flag type, but didn't actually transition and
remove the flag type because it would have been too much mundane work.
2023-02-21 17:15:17 +00:00
Thomas Weißschuh 9efce6d4ae various: drop unused #include "config.h"
Most sources don't need config.h.
The inclusion only leads to lots of unneeded recompilation if the
configuration is changed.
2023-02-20 14:21:18 +00:00
Alby 88918411f3 stream: accept webdav:// and webdavs:// urls
Treat them as http:// and https:// respectively. This allows to play files
on webdav archives directly on KDE, avoiding the (extremely slow) local
copying performed by kio.
2023-01-31 12:03:41 -05:00
Dudemanguy 5510d9f663 stream/dvb: remove some unused variables
Missed in b6b8380518.
2023-01-24 21:21:02 -06:00
Thomas Weißschuh fd2f1a6f9a stream: remove trailing NULL element from stream list 2023-01-17 14:01:47 +01:00
sfan5 b6b8380518 stream/dvb: drop support for DVB API before 5.8
There is really no reason to keep the #ifdef mess around given
that version is available since December 2012 (Linux 3.7).
2023-01-12 22:02:07 +01:00
sfan5 d54f22f8b6 stream/cookies: use stream_read_file()
No need for this redundant implementation.
2023-01-12 22:02:07 +01:00
The-head-obamid f344d481a5 stream_lavf: enable RIST protocol support via ffmpeg 2022-08-18 11:33:50 +02:00
Mark Gaiser 3458651010 stream_lavf: add support for ipfs and ipns
ffmpeg 5.1 adds support for IPFS (the ipns:// and ipfs:// protocols).
This patch enables those protocols to be fist-class citizens in mpv.
Thus allowing for playing IPFS resources on mpv like:
"mpv ipfs://QmbGtJg23skhvFmu9mJiePVByhfzu5rwo74MEkVDYAmF5T"
2022-05-05 16:20:31 +00:00
Oliver Freyermuth 3d9c0eae9e stream_dvb: add missing mutex unlock
This deadlock was not triggered in real use since configuration
validity does not change at runtime.

closes #9459
2021-11-16 22:24:14 +01:00
Nicolas F 5bf92b628d stream/dvbin: remove "full-featured" API includes
In Linux kernel commit 819fbd3d8ef36c09576c2a0ffea503f5c46e9177
these two header files were moved to staging (though they've since
been moved out again by Linus.)

We do not actually use this, and it's in a state of maybe-removal
from the kernel as of Linux 5.14. Get rid of it; mpv still builds
fine without it, so it wasn't needed anyways.

Fixes #9233.
2021-09-22 19:48:14 +03:00
Dudemanguy 8fc8df3d39 stream_lavf: remove uninitialized http_like array
Serves no purpose and can be a fatal error on certain compiler settings.
Just move the other http_like up here instead.
2021-05-18 13:25:06 -05:00
der richter f8128f6570 stream_file: disable read ahead for remote files on macOS
this can cause stutter on remote files because in certain cases this
causes a reconnect to the remote that leads to the file not being read
fast enough. VLC had the same problem and fixes it the same way.
b8b8c438f8

Fixes #4434
2021-05-16 13:48:45 +02:00
der richter 01482c63ca stream_file: add new identifier for macOS FUSE filesystems
the new identifier for osxfusefs is macfuse, but we will keep both since
the older releases are still used.
2021-04-24 14:22:54 +03:00
sfan5 5117fa70af stream: turn stream_info.open2's args argument const
So nobody comes up with the "smart" idea to modify those again.
2021-04-08 23:47:35 +03:00
sfan5 6be613c178 stream_slice: fix use-after-free if inner stream fails to open
The args struct is reused to attempt opening an URL with
different stream layers, overwriting args->url not only
breaks this but also causes the freed buffer to be used again.
2021-04-08 23:47:35 +03:00
sfan5 9c120dedb3 stream_mf: set correct stream origin
mf:// reads files from the local filesystem and should be
subject to the usual security checks mpv has for such protocols.
2021-04-08 23:47:35 +03:00
parazyd 6a903a9a08 stream_lavf: add support for Gopher over TLS.
Gopher over TLS (gophers) is a community-adopted protocol and has recently
been merged in:
 - curl (a1f06f32b8603427535fc21183a84ce92a9b96f7)
 - ffmpeg (51367267c8a9f1a840f5e810f8c788e6e03712a5)
2021-03-15 00:56:11 +02:00
Mia Herkt 8753bd0198
stream_lavf: support rtsps
Fixes #8480
2021-01-19 13:10:58 +01:00
Leo Izen 9b5672ebed manpage: document improved --playlist security
Recent versions of mpv have applied security checks to --playlist
that previously only existed if playlist files were played as an
input directly. This commit documents this change and how to work
around it, in the event that playlist files are trusted.
2020-11-18 17:30:07 -05:00