summaryrefslogtreecommitdiffstats
path: root/stream
Commit message (Collapse)AuthorAgeFilesLines
* stream_lavf: don't add ffmpeg bluray or dvd protocolsDudemanguy13 days1-0/+4
| | | | | | The naming of these conflict with existing mpv protocols, so skip if we get them. Users can still use them via lavf://bluray: or lavf://dvd: if they wish.
* stream: implement get_protocols method for stream_lavfDudemanguy13 days3-25/+123
| | | | | | | | | | | | | | | Previously, all stream protocols were a static list in mpv. This is okay for own builtin stuff, but for protocols that depend on ffmpeg it's not so great. Support for certain protocols may or may not be enabled in a user's ffmpeg and the protocol list that mpv generates should ideally match this. Fix this by implementing a get_protocols method for stream_lavf that will have different results depending on the ffmpeg mpv is built against. We keep the safe and unsafe protocols separation. The former is essentially a whitelist. Any protocol that is found in ffmpeg but is not in the safe whitelist is considered unsafe. In the stream list, ffmpeg is moved to the bottom so any possible protocols that are added in the future don't automatically take precedence over any builtin mpv ones.
* stream: remove directory playlist hintsfan52024-05-151-2/+0
| | | | | The stream layer is the wrong place to handle this and the benefit seems dubious.
* stream: check file descriptor passed to fd:// or fdclose://sfan52024-05-151-2/+8
|
* various: add missing checks for directory streamssfan52024-05-154-3/+19
| | | | | All of this code opens a stream and expects to read stuff from a file. But streams can also be directories and that has to be handled.
* stream: disallow reading or writing to directoriessfan52024-05-151-2/+9
| | | | | | | Reading an entire file is a common operation, meanwhile stream_file will happily open a directory. This doesn't match well. Analogously for open_output_stream().
* Revert "stream: don't try to read from all-sparse/no-data files"sfan52024-05-121-11/+0
| | | | | | | | The stream layer is just not the right place to make this change since it's also used for completely unrelated purposes such as reading configs. This reverts commit bb7a485c0932375b888a61966970696c06851a15.
* stream: don't try to read from all-sparse/no-data filesMohammad AlSaleh2024-05-071-0/+11
| | | | | | | | | | | | | | | | | | | ``` dd if=/dev/zero of=/tmp/10g.empty bs=1 seek=10G count=0 dd if=/dev/zero of=/tmp/10m.empty bs=1 seek=10M count=0 time mpv /tmp/10{g,m}.empty ``` I keep files with the name format `${name}-${hash}.${ext}.empty` around, where the original is removed, and a sparse file with the size of the original is created instead. A lot of time is wasted on such files when going through playlists/directories that include some of them. This admittedly may not be that common of a use-case. Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
* various: fix indentationnanahi2024-05-076-91/+91
|
* stream_file: declare structures available only in Windows DDKKacper Michajłow2024-05-061-0/+27
|
* win32: fix platform checksKacper Michajłow2024-05-061-4/+4
|
* osdep/dirent: add implementation for Windows SDK buildKacper Michajłow2024-05-061-1/+0
|
* various: move strings.h inclusion to common.hKacper Michajłow2024-05-063-3/+0
|
* various: move unistd.h inclusion to common.hKacper Michajłow2024-05-066-6/+1
|
* various: fix -Wold-style-declaration warningnanahi2024-03-191-1/+1
| | | | warning: `static' is not at beginning of declaration
* various: use static assertions where appropriatesfan52024-03-171-1/+1
|
* stream: enable caching for sockets, pipes and FIFOsbptato2024-03-161-1/+5
| | | | | | This is useful e.g. when the caller dup2's a socket into stdin, or passes a socket/pipe as /dev/fd/{fd}, because it is impossible to seek on sockets and pipes.
* stream: increase max_size to INT_MAX minus paddingKacper Michajłow2024-01-312-1/+4
| | | | | No need to magic number limit, we can support up to INT_MAX with current code. Which should be more than enough.
* common: stream: don't mention Libav in errors/warningsllyyr2024-01-201-1/+1
|
* meson: adjust win32 definesKacper Michajłow2023-11-251-0/+1
| | | | | | | | - 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
* various: add some missing error checksKacper Michajłow2023-11-181-0/+2
|
* mp_thread: add win32 implementationKacper Michajłow2023-11-051-1/+0
|
* ALL: use new mp_thread abstractionKacper Michajłow2023-11-052-14/+11
|
* dvbin: do a big cleanup on code style and functionssfan52023-10-213-349/+300
|
* stream_dvb: avoid static function variablesfan52023-10-212-4/+4
|
* dvb_tune: remove use of time()sfan52023-10-211-4/+4
|
* dvbin: revise many log linessfan52023-10-212-86/+50
|
* stream_dvb: use tallocsfan52023-10-212-80/+19
|
* stream_dvb: fix missing newlines on log messagessfan52023-10-211-6/+6
|
* stream_cdda: deprecate --cdda-toc-bias and always check for offsetsDudemanguy2023-10-191-4/+3
| | | | | | | | | | | | | | | | 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.
* stream_cdda: remove printing track info in fill_bufferDudemanguy2023-10-191-9/+0
| | | | | | | | | | 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.
* stream_cdda: remove fallback for ancient libcdio versionsDudemanguy2023-10-191-36/+6
| | | | | | 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.
* stream_cdda: suppress -Wstrict-prototypes from cdioKacper Michajłow2023-10-191-0/+3
|
* stream_lavf: use metadata-codepage option for codepage conversionDudemanguy2023-10-071-0/+16
| | | | | | a343666ab5121e7a3388be9aa2d8731d6d1f2f64 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.
* win32/pthread: define _POSIX_TIMERS to notify they are not supportedKacper Michajłow2023-09-292-0/+3
|
* stream: remove unneeded mp_read_option_raw callDudemanguy2023-09-221-3/+4
| | | | We can get the group from demux_conf instead and use that.
* stream_bluray: move --bluray-device to stream_bluray_optsDudemanguy2023-09-221-2/+23
| | | | | | 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.
* stream_cdda: move cdrom-device to cdda_paramsDudemanguy2023-09-221-7/+4
| | | | | | 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.
* options: remove ancient option fallbacks/deprecationDudemanguy2023-09-211-1/+0
| | | | | | | | | | | | | 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. 26f4f18c0629998a9b91e94722d166866d8b80a3 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.
* stream: accept dav:// and davs:// urlsY0J1G3N2023-09-111-5/+5
| | | | 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.
* stream/dvbin: drop too verbose messagesOliver Freyermuth2023-09-031-2/+0
| | | | | Echoing channel config format detection for each channel is a bit too noisy.
* stream/dvbin: add some helpful verbose outputOliver Freyermuth2023-09-031-0/+2
| | | | | These verbose messages will help in case adapter detection / channel list parsing fails.
* stream/dvbin: detect ZAP channel configs looking like VDR configsOliver Freyermuth2023-09-031-1/+13
| | | | | | | | | 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.
* stream/dvbin: do not forget channel list for multiply delivery systemsOliver Freyermuth2023-09-031-2/+2
| | | | | | | | | | 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.
* stream/dvbin: add support for delivery system ISDB-TOliver Freyermuth2023-09-033-0/+11
| | | | | | 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.
* options: remove explicit initialization of integers to 0Christoph Heinrich2023-02-211-1/+0
|
* options: transition commands from OPT_FLAG to OPT_BOOLChristoph Heinrich2023-02-211-0/+1
|
* options: transition options from OPT_FLAG to OPT_BOOLChristoph Heinrich2023-02-216-16/+15
| | | | | | c78482045444c488bb7948305d583a55d17cd236 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.
* various: drop unused #include "config.h"Thomas Weißschuh2023-02-205-9/+0
| | | | | | Most sources don't need config.h. The inclusion only leads to lots of unneeded recompilation if the configuration is changed.
* stream: accept webdav:// and webdavs:// urlsAlby2023-01-311-1/+9
| | | | | | 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.
* stream/dvb: remove some unused variablesDudemanguy2023-01-241-3/+0
| | | | Missed in b6b83805183618f3a46f2cc77d85dcff72ef6396.
* stream: remove trailing NULL element from stream listThomas Weißschuh2023-01-171-4/+3
|
* stream/dvb: drop support for DVB API before 5.8sfan52023-01-123-208/+14
| | | | | There is really no reason to keep the #ifdef mess around given that version is available since December 2012 (Linux 3.7).
* stream/cookies: use stream_read_file()sfan52023-01-123-60/+21
| | | | No need for this redundant implementation.
* stream_lavf: enable RIST protocol support via ffmpegThe-head-obamid2022-08-181-1/+1
|
* stream_lavf: add support for ipfs and ipnsMark Gaiser2022-05-051-1/+1
| | | | | | | 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"
* stream_dvb: add missing mutex unlockOliver Freyermuth2021-11-161-0/+1
| | | | | | | This deadlock was not triggered in real use since configuration validity does not change at runtime. closes #9459
* stream/dvbin: remove "full-featured" API includesNicolas F2021-09-221-2/+0
| | | | | | | | | | | | 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.
* stream_lavf: remove uninitialized http_like arrayDudemanguy2021-05-181-4/+2
| | | | | Serves no purpose and can be a fatal error on certain compiler settings. Just move the other http_like up here instead.
* stream_file: disable read ahead for remote files on macOSder richter2021-05-161-1/+8
| | | | | | | | | 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. https://github.com/videolan/vlc/commit/b8b8c438f8f65a93da82364c8fea1dbf987c4a8e Fixes #4434
* stream_file: add new identifier for macOS FUSE filesystemsder richter2021-04-241-1/+1
| | | | | the new identifier for osxfusefs is macfuse, but we will keep both since the older releases are still used.
* stream: turn stream_info.open2's args argument constsfan52021-04-085-5/+5
| | | | So nobody comes up with the "smart" idea to modify those again.
* stream_slice: fix use-after-free if inner stream fails to opensfan52021-04-081-2/+3
| | | | | | 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.
* stream_mf: set correct stream originsfan52021-04-081-0/+1
| | | | | mf:// reads files from the local filesystem and should be subject to the usual security checks mpv has for such protocols.
* stream_lavf: add support for Gopher over TLS.parazyd2021-03-151-1/+1
| | | | | | | Gopher over TLS (gophers) is a community-adopted protocol and has recently been merged in: - curl (a1f06f32b8603427535fc21183a84ce92a9b96f7) - ffmpeg (51367267c8a9f1a840f5e810f8c788e6e03712a5)
* stream_lavf: support rtspsMia Herkt2021-01-191-4/+4
| | | | Fixes #8480
* manpage: document improved --playlist securityLeo Izen2020-11-181-2/+1
| | | | | | | 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.
* stream_lavf: enable SRT protocol support through FFmpegAlexandre Iooss2020-10-151-1/+1
| | | | | Additionally, announce support for the protocol in Mac and Linux application metadata.
* stream_slice: interpret `end` as offset if it starts with '+'Mohammad AlSaleh2020-09-171-0/+4
| | | | | | | | Example: slice://1g-2g@file.ts (1 to 2) slice://1g-+2g@file.ts (1 to 3) Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
* stream: Implement slice:// for reading slices of streamsMohammad AlSaleh2020-08-192-0/+178
| | | | | | | | | | | | | | | | Add support for reading a byte range from a stream via the `slice://` protocol. Syntax is `slice://start[-end]@URL` where end is a maximum (read until end or eof). Size suffixes support in `m_option` is reused so they can be used with start/end. This can be very useful with e.g. large MPEGTS streams with corruption or time-stamp jumps or other issues in them. Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
* demux_lavf: workaround reading gif from unseekable streamswm42020-07-092-1/+10
| | | | | | | FFmpeg, being the pile of trash as usual, recently broke this. Add our own trash hack to trashily workaround this shit. Fixes: #7893
* stream: make stream_read_file() more robustwm42020-05-103-23/+41
| | | | | | | | | Change it to strictly accept local paths only. No more http://, no more $HOME expansion with "~/" or mpv config path expansion with "~~/". This should behave as if passing a path directly to open(). Reduce annoying log noise to further facilitate it using as open() replacement.
* stream_libarchive: remember archive headers from initial openKevin Mitchell2020-04-282-17/+50
| | | | | | | | | | | | | | | | | | The header probing hacks were previously all broken. They only worked the first time the archive file was open. Since subsequent opens (on seek) occured in the middle of the source stream rather than at the beginning, the stream_read_peek calls meant to retrieve the headers were instead returning random bytes in the middle of the file. Perhaps the worst manifestation of this was when seeking within a multi-volume .rar archive with the "legacy" file naming pattern. If the seek required a reopen, the fact that the archive was multi-volume would be forgotten and the file would appear truncated terminating playback. To solve this, only perform the header probling the first time the archive is opened. Save the results and reuse them on subsequent reopens. Put this in a wrapper so this is transparent to demux_libarchive.
* stream_libarchive: simplify multi-volume rar hate messageKevin Mitchell2020-04-271-14/+8
| | | | | | | | I couldn't find any reason for this message to be so far dispalced from where it's necessity was determined. That necessity is not however in question. Also improve the wording and line breaking.
* stream_libarchive: put multi_rar check in a functionKevin Mitchell2020-04-271-10/+14