summaryrefslogtreecommitdiffstats
path: root/stream
Commit message (Collapse)AuthorAgeFilesLines
* stream_dvb: fix minor resource leakswm42016-02-121-0/+3
| | | | | | Fixes CID 1350062 and 1350061. Just for the sake of shutting up Coverity.
* stream_dvb: remove dead codewm42016-02-121-5/+0
| | | | Fixes CID 1350063.
* dvb: fix segmentation fault in case no valid configuration is found.Oliver Freyermuth2016-01-241-2/+3
| | | | This was introduced in c55b242 .
* dvb: remove trailing whitespacewm42016-01-222-18/+18
|
* dvb: fix compilation with older Linux headerswm42016-01-221-1/+2
| | | | | | | At least DTV_ENUM_DELSYS is not available in older versions. It's hard to tell when this identifier was introduced, but it appears it was probably API version 5.5.
* stream_dvb: add verbose output in non-DVBv5 querying.Oliver Freyermuth2016-01-211-1/+3
| | | | | May help in future debugging in case of old kernels with modern / obscure devices.
* stream_dvb: use DVBv5 API also for DVB-C tuning.Oliver Freyermuth2016-01-211-8/+39
| | | | | | | | | | | Using the new API is a necessity for multiple-delivery-system devices, since the old API does not offer a way to switch the delivery system of the card. This should in principle also be done for DVB-T / ATSC, especially since most DVB-T devices also support DVB-C, but I can not test such an implementation due to lack of hardware (currently) so it seems better to leave the existing, tested code-path in place for now.
* stream_dvb: improve messages on delivery-type detection.Oliver Freyermuth2016-01-211-10/+14
| | | | | | | | No need use use all capital letters, and don't warn if DVB-S2 is supported in addition since we handle that in DVB-S case already. Also, print the delivery system number for still unhandled delivery systems to simplify debugging.
* stream_dvb: don't requery tuner type, rely on initial query.Oliver Freyermuth2016-01-211-11/+9
| | | | | | | | | Saves one unnecessary additional ioctl per tuning by just reusing existing information. Should also fix the case of multiple supported delivery types since we now rely on the initial query from the chosen configuration after channel list parsing instead of requerying the device.
* stream_dvb: support frontends with multiple delivery systems.Oliver Freyermuth2016-01-213-59/+122
| | | | | | | | | Most common case would be DVB-C / DVB-T combination cards. Cards with multiple delivery systems are only supported starting from DVBv5 API (Kernel 2.6.38). In this case, we loop over all delivery systems and just treat them as different cards would be treated: They all get their own TUNER-type, channel-list parsing etc.
* Relicense some non-MPlayer source files to LGPL 2.1 or laterwm42016-01-193-21/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This covers source files which were added in mplayer2 and mpv times only, and where all code is covered by LGPL relicensing agreements. There are probably more files to which this applies, but I'm being conservative here. A file named ao_sdl.c exists in MPlayer too, but the mpv one is a complete rewrite, and was added some time after the original ao_sdl.c was removed. The same applies to vo_sdl.c, for which the SDL2 API is radically different in addition (MPlayer supports SDL 1.2 only). common.c contains only code written by me. But common.h is a strange case: although it originally was named mp_common.h and exists in MPlayer too, by now it contains only definitions written by uau and me. The exceptions are the CONTROL_ defines - thus not changing the license of common.h yet. codec_tags.c contained once large tables generated from MPlayer's codecs.conf, but all of these tables were removed. From demux_playlist.c I'm removing a code fragment from someone who was not asked; this probably could be done later (see commit 15dccc37). misc.c is a bit complicated to reason about (it was split off mplayer.c and thus contains random functions out of this file), but actually all functions have been added post-MPlayer. Except get_relative_time(), which was written by uau, but looks similar to 3 different versions of something similar in each of the Unix/win32/OSX timer source files. I'm not sure what that means in regards to copyright, so I've just moved it into another still-GPL source file for now. screenshot.c once had some minor parts of MPlayer's vf_screenshot.c, but they're all gone.
* cache: add mechanism for disabling readaheadwm42016-01-182-1/+17
| | | | Will be used in a following commit.
* player, stream_dvb: implement dvb-channel-name property.Oliver Freyermuth2016-01-143-1/+37
| | | | | | | | | On read, it returns the name of the current DVB program, on write, it triggers a channel-switch to the program if it is found in the channel list of the currently active card. Compared to the dvb-channel property which already exists and is a pair of integers (card + channel number) this has the limitation of not switching the card, but is probably of much more common use.
* stream_dvb: global protection mutex and usage bit for global_dvb_state.Oliver Freyermuth2016-01-142-1/+21
| | | | | | | | | | | | | The mutex is used in dvbin_open and dvbin_close only since these are the only entry / exit points to the stream. When opening, it is first checked (mutexed) whether the state already exists and is in use, then a STREAM_ERROR is returned, since there may be only one stream_dvb active at a time. State-creation itself is also protected by mutex. In dvbin_close, the usage-bit is set to false (mutexed) in case of channel switch. In case of stream-teardown, the state is destructed (also protected by mutex).
* stream_dvb: implement GET_METADATA and return program name.Oliver Freyermuth2016-01-141-2/+13
| | | | Now title will be the current channel name also after channel switch.
* stream_dvb: persist state-information across channel-switches.Oliver Freyermuth2016-01-142-35/+71
| | | | | | | | | The state-structure is kept in a static pointer and reused on recreation of the stream. To not leak the state and the FDs within upon mpv shutdown, the state-structure is still destructed gracefully in dvbin_close(), unless a channel switch has been initiated directly before. This fixes channel-switching for DVB which was broken since a609877.
* dvb: rename dvb_config_t to dvb_state_t, keep config and state there.Oliver Freyermuth2016-01-143-117/+128
| | | | | | | | | The state-struct now contains everything which can be kept after initial initialization. This includes the channel-lists, configuration, device-fds and also information like current channel and current card. The dvb_priv_t is kept containing the mp-options, a pointer to the state and to the logger. After this restructuring, the state-struct contains all information which can be persisted across channel switching.
* stream: stream_read_complete() reads from current pos, not 0wm42016-01-121-1/+1
| | | | (Well, I hope no caller really relied on this anyway.)
* mpv_talloc.h: rename from talloc.hDmitrij D. Czarkoff2016-01-116-6/+6
| | | | This change helps avoiding conflict with talloc.h from libtalloc.
* cache: remove useless return valuewm42016-01-111-5/+2
| | | | It was unused, and also returned the wrong value in some cases.
* dvb: cleanup dvb_params struct, remove some unneeded fdsOliver Freyermuth2016-01-073-11/+8
| | | | | | | One was just used as an alias, the other one (sec_fd) was not used at all. Signed-off-by: wm4 <wm4@nowhere>
* win32: fix fd://James Ross-Gowan2016-01-071-3/+4
| | | | | | | | Windows definitely supports Unix-style fd inheritance. This mostly worked when launched from mpv.exe, though mpv should change the file mode to O_BINARY. When launched from mpv.com, the wrapper must pass the list of handles (stored in the undocumented lpReserved2 and cbReserved2 fields) to the mpv process.
* stream_lavf: remove tabswm42015-12-221-2/+2
| | | | Death to tabs.
* Fix some typos in code commentsAman Gupta2015-12-211-1/+1
| | | | Signed-off-by: wm4 <wm4@nowhere>
* stream: drop PVR supportwm42015-12-102-1619/+0
| | | | | | | | | This is only for specific Hauppage cards. According to the comments in who is actively using this feature. Get it out of the way. Anyone who still wants to use this should complain. Keeping this code would not cause terribly much additional work, and it could be restored again. (But not if the request comes months later.)
* stream_libarchive: make libarchive seek callback lazyKevin Mitchell2015-11-091-3/+22
| | | | This fixes problems seeking http streams to their end.
* stream_libarchive: add multivolume supportKevin Mitchell2015-11-092-16/+156
| | | | | | | | | | | | | | This commit introduces logic to read other volumes from the same source as the primary archive. Both .rar formats as well as 7z are supported for now. It also changes the libarchive callback structure to be per-volume consistent with the libarchive intenal client data array constructed with archive_read_append_callback_data. Added open, close and switch callbacks. Only the latter is strictly required to make sure that the streams always start at position 0, but leaving all volumes open can eat a lot of memory for archives with many parts.
* libarchive: remove redundant log prefixKevin Mitchell2015-11-091-3/+3
| | | | "libarchive:" is already added by the logging system
* stream/audio: fix unchecked strdupswm42015-10-304-11/+23
| | | | | See #2435. It's literally a waste of time trying to fix minor memory leaks in this old, unused, and crappy code.
* options: add support for client certificate authenticationJoschka Tillmanns2015-10-201-0/+4
| | | | | | | | Client certificates are supported by ffmpeg as documented here: > https://www.ffmpeg.org/ffmpeg-protocols.html#tls Signed-off-by: wm4 <wm4@nowhere>
* stream: minor cleanup to verbose loggingwm42015-09-302-3/+4
| | | | | | Don't print the URL that is opened twice. stream.c and stream_lavf.c each printed it once. Remove the logging from stream_lavf.c, and move the log call to a more interesting point.
* cache: do not include backbuffer size in total stream cache sizewm42015-09-101-1/+1
| | | | | | | | | This causes weirdness with the "cache-size" property and option. Only the read handler of the property included the backbuffer, while all others did not. Make it consistent, and subtract the backbuffer size from the cache size. Fixes #2305.
* stream_libarchive: read tar only in "unsafe" modewm42015-08-221-2/+4
| | | | | | | | | | As expected, probing with libarchive is a disaster. Both libavformat and libarchive are too eager to misdetect file formats just because files "might" be of a specific type. In this case, it's mp3 vs. tar. To be fair, neither file format has an actual header. I'm not sure why we'd need tar support, but since libarchive provides it, and idiots on the internet apparently pack media files in tar sometimes (really, idiots), keep it for now, and probe tar last.
* stream_libarchive: disable raw filterwm42015-08-201-2/+0
| | | | | Too many false positives (it accepts things like unspecific text files), and also relatively useless.
* stream_libarchive: fix libarchive callback signaturewm42015-08-201-1/+1
| | | | | | | | | | | libarchive uses a quite confusing ifdeffery mess for some of the types used in callbacks. Currently, archive_read_set_seek_callback() causes a warning at least on Windows due to mismatching return type. The header file uses __LA_INT64_T as return type, so I think the user is intended to use int64_t. (The ssize_t return type for the read_cb seems correct, on the other hand.)
* stream_libarchive: restrict number of allowed formatswm42015-08-181-2/+11
| | | | | Most of what is not in this list is extremely obscure, or increases the file format misdetection rate.
* stream: provide a stream_get_size() convenience functionwm42015-08-185-11/+17
| | | | | And use it everywhere, instead of retrieving the size manually. Slight simplification.
* demux_libarchive: open flat compressed fileswm42015-08-172-3/+9
| | | | | | | | Things like .gz etc., which have no real file header. A mixed bag, because it e.g. tends to misdetect mp3 files as compressed files or something (of course it has no mp3 support - I don't know as what it detects them). But requested by someone (or maybe not, I'm not sure how to interpret that).
* stream: libarchive wrapper for reading compressed archiveswm42015-08-173-0/+274
| | | | | | | | | | | | | | | | | | | | This works similar to the existing .rar support, but uses libarchive. libarchive supports a number of formats, including zip and (most of) rar. Unfortunately, seeking does not work too well. Most libarchive readers do not support seeking, so it's emulated by skipping data until the target position. On backwards seek, the file is reopened. This works fine on a local machine (and if the file is not too large), but will perform not so well over network connection. This is disabled by default for now. One reason is that we try libarchive on every file we open, before trying libavformat, and I'm not sure if I trust libarchive that much yet. Another reason is that this breaks multivolume rar support. While libarchive supports seeking in rar, and (probably) supports multivolume archive, our support of libarchive (probably) does not. I don't care about multivolume rar, but vocal users do.
* stream: remove remaining DVD/BD menu definitionswm42015-08-032-88/+0
|
* stream_bluray: remove menu implementationwm42015-08-031-358/+11
|
* stream_dvdnav: rip out lower-level menu implementationwm42015-08-031-255/+7
| | | | Separate because it might cause regressions.
* win32: revert wchar_t changeswm42015-08-011-1/+1
| | | | | | | | | | | Revert "win32: more wchar_t -> WCHAR replacements" Revert "win32: replace wchar_t with WCHAR" Doing a "partial" port of this makes no sense anymore from my perspective. Revert the changes, as they're confusing without context, maintenance, and progress. These changes were a bit premature anyway, and might actually cause other issues (locale neutrality etc. as it was pointed out).
* win32: more wchar_t -> WCHAR replacementswm42015-07-301-1/+1
| | | | | | | | | | | | | This was essentially missing from commit 0b52ac8a. Since L"..." string literals have the type wchar_t[], we can't use them for UTF-16 strings. Use C11 u"..." string literals instead. These have the type char16_t[], but we simply assume char16_t is the same underlying type as WCHAR. In practice, they're both unsigned short. For this reason use -std=c11 on Windows. Since Windows is a "special" environment (we require either MinGW or Cygwin), we don't need to worry too much about compiler compatibility.
* cache: make backbuffer size configurablewm42015-07-221-5/+12
| | | | | | | | | | Allow setting an arbitrary amount, instead of the fixed 50%. This is nto striclty backwards compatible. The defaults don't change, but the --cache/--cache-default options now set the readahead portion. So in practice, users who configured this until now will see the double amount of cache being used, _plus_ the 75MB default backbuffer will be in use.
* cache: fix backbuffer logicwm42015-07-221-4/+5
| | | | | | Currently, this is perfectly equivalent, because back_size is hardcoded to buffer_size/2. But this fixes the logic for the case the back_size can be configured freely.
* stream_file: remove an indirectionwm42015-07-101-17/+13
| | | | Remove the "fd" local variable, and always use "p->fd" directly.
* stream_file: cosmetics: shorten variable namewm42015-07-101-10/+10
| | | | Can't be bothered to type this much.
* stream_file: initialize `fd`Ben Boeckel2015-07-091-1/+2
| | | | | Use the fd variable and delay assignment to priv->fd to mirror other branches of the if/else tree.
* stream_file: add fd:// protocolwm42015-07-091-2/+10
|
* Disable DVD and BD menu support (to be removed)wm42015-06-262-0/+4
| | | | | | | | | | | | | | | | | | DVD/BD menu support never worked right, and are a pain to maintain. In particular, DVD menus never actually worked correctly, because highlights were not rendered correctly. Fixing this requires major effort, which I'm not interested to spend. Most importantly, the requirement to switch streams without losing the DVD/BD state caused major weirdness in the playback core. It was implemented by somehow syncing the playback state to the DVD/BD implementation (in stream_dvdnav.c etc.), and then reloading the demuxer without destroying and recreating the stream. This caused a bunch of special-cases which I'm looking forward to remove. For now, don't just remove everything related to menu support and just disable it. If someone volunteers, it can be restored (i.e. rewritten) in a reasonable way. If nobody volunteers soon, it goes.
* cache: limit readahead size to half the cache size at the beginningwm42015-05-291-0/+6
| | | | | | | | | | | | | | | | | | | | | | Normally, the cache keeps 50% of the buffer for seeking backwards. Until now, the cache just used the full buffer size at the beginning of a file, because the 50% normally reserved for the backbuffer are unused. This caused a problem: when streaming from http, the player would first read about 150MB (default cache size), then stop until 75MB of the cache has been played. (Until the 75MB position, the cache is fully used, so nothing new can be read. After that, part of the backbuffer starts getting unreserved, and can be used for readahead.) This long read pause can cause the server to terminate the connection. Reconnecting may be possible, but if youtube-dl is used, the media URL may have become invalid. Fix this by limiting readahead to 50% even if unnecessary. The only exception is when the whole file would fit in the cache. In this case, it won't matter if we can't reconnect, because the cache covers everything anyway, and hopefully the cache will stay valid. Likely fixes #2000.
* vo_opengl: add support for custom shadersNiklas Haas2015-05-272-0/+16
|
* command: add protocol-list propertywm42015-05-232-6/+22
| | | | Fixes #1972.
* Remove trailing whitespacesMichael Vetter2015-05-151-4/+4
|
* threads: use utility+POSIX functions instead of weird wrapperswm42015-05-111-3/+6
| | | | | | | There is not much of a reason to have these wrappers around. Use POSIX standard functions directly, and use a separate utility function to take care of the timespec calculations. (Course POSIX for using this weird format for time values.)
* path: make mp_path_join accept normal C stringswm42015-05-092-4/+4
| | | | | Instead of bstr. Most callers of this function do not need bstr. The bstr version of this function is now mp_path_join_bstr().
* stream: don't print reconnection message if no stream supportwm42015-04-291-3/+5
| | | | | | | This code does not know whether the stream supports reconnecting until STREAM_CTRL_RECONNECT is called. So the message should be printed after it. To avoid that reconnects that succeed on the first try go unnoticed, print a warning on success.
* cache: exit early on cancellationwm42015-04-211-0/+3
| | | | | | | An approximate measure to make it exit possibly slightly earlier. Relatively speaking, some time will pass between cancellation and the cache actually being requested to exit, so it's good if the cache returns EOF immediately.
* cache: another minor simplificationwm42015-04-211-11/+5
| | | | | | | | The caller can check for cache interruption instead. There's no need to define special return values and such. It would be rather hard to make waiting for the condition and stream cancellation atomic too (and pointless, since the underlying stream will also be "cancelled" and exit early), so nothing about cancellation being a separate call will change.
* cache: simplify the check for printing the "cache stuck" messagewm42015-04-211-16/+6
| | | | | | | | | | | | This put some effort into distinguishing between two messages to print - all worthless. Even more so, this kept printing the message, which doesn't feel overly useful either. (The message will be printed repeatedly anyway if network recovers for a while and then gets stuck again.) All in all, the demuxer cache triggering the buffering state does a better job here. But don't remove it completely, since knowing that the network did nothing for a relatively short time is still useful.
* command: disc-mouse-on-button propertyxylosper2015-04-213-6/+12
| | | | | This property indicates whether mouse cursor is located on button or not for disc naviation.
* stream_file: minor simplificationwm42015-04-171-11/+8
| | | | | Now all this platform-specific code doesn't depen