aboutsummaryrefslogtreecommitdiffhomepage
path: root/stream
Commit message (Collapse)AuthorAge
* cache, dvd, bluray: simplify stream time handlingGravatar wm42014-07-07
| | | | | | | | | | | | | | | | | | We used a complicated and approximate method to cache the stream timestamp, which is basically per-byte. (To reduce overhead, it was only cached per 8KB-block, so it was approximate.) Simplify this, and read/keep the timestamp only on discontinuities. This is when demux_disc.c actually needs the timestamp. Note that caching is currently disabled for dvdnav, but we still read the timestamp only after some data is read. libdvdread behaves well, but I don't know about libbluray, and the previous code also read the timestamp only after reading data, so try to keep it safe. Also drop the start_time offset. It wouldn't be correct anymore if used with the cache, and the idea behind it wasn't very sane either (making the player to offset the initial playback time to 0).
* stream_dvdnav: more debugging outputGravatar wm42014-07-06
|
* stream: remove now unused STREAM_CTRL_GET_START_TIMEGravatar wm42014-07-06
| | | | demux_disc.c takes care of this now.
* tv: move demuxer parts to separate fileGravatar wm42014-07-05
| | | | | Now all demuxer implementations (at least demuxer API-wise) are in the demux directory.
* demux: minor simplification to internal APIGravatar wm42014-07-05
| | | | Also some other unrelated minor changes.
* dvd, bluray, cdda: add demux_disc containing all related hacksGravatar wm42014-07-05
| | | | | | | | | | | | DVD and Bluray (and to some extent cdda) require awful hacks all over the codebase to make them work. The main reason is that they act like container, but are entirely implemented on the stream layer. The raw mpeg data resulting from these streams must be "extended" with the container-like metadata transported via STREAM_CTRLs. The result were hacks all over demux.c and some higher-level parts. Add a "disc" pseudo-demuxer, and move all these hacks and special-cases to it.
* demux, stream: change metadata notificationGravatar wm42014-07-05
| | | | | | | | | | | | (Again.) This time, we simply make it event-based, as it should be. This is done for both demuxer metadata and stream metadata. For some ogg-over-icy streams, 2 updates are reported on stream start. This is because libavformat reports an update right on start, while including the same info in the "static" metadata. I don't know if that's a bug or a feature.
* stream_dvdnav: check the length of all titles with dvdnav://longestGravatar tholin2014-07-04
| | | | | | | | The last title was ignored before. CC: @mpv-player/stable Signed-off-by: wm4 <wm4@nowhere>
* stream_dvdnav: free pointer to priv->filename on closeGravatar tholin2014-07-04
| | | | | | CC: @mpv-player/stable Signed-off-by: wm4 <wm4@nowhere>
* stream_dvdnav: make sure seeking bounds are within rangeGravatar tholin2014-07-04
| | | | | | | | libdvdnav returns an error is the seek position is out of range. CC: @mpv-player/stable Signed-off-by: wm4 <wm4@nowhere>
* cache_file: use unicode on windowsGravatar wm42014-07-02
| | | | This enables the MinGW Windows crap wrapper for fopen().
* cache: clear DVD timestampsGravatar wm42014-07-02
| | | | | | | | | | | | When resizing the cache, the buffer for the DVD timestamps is initialized with 0. This causes the player to always return playback position 0 with any file format (not just DVD), and also makes all relative seeks relative to position 0. Fix this by clearing the timestamps explicitly. Closes #899. CC: @mpv-player/stable
* Audit and replace all ctype.h usesGravatar wm42014-07-01
| | | | | | | | | | | | | | | | Something like "char *s = ...; isdigit(s[0]);" triggers undefined behavior, because char can be signed, and thus s[0] can be a negative value. The is*() functions require unsigned char _or_ EOF. EOF is a special value outside of unsigned char range, thus the argument to the is*() functions can't be a char. This undefined behavior can actually trigger crashes if the implementation of these functions e.g. uses lookup tables, which are then indexed with out-of-range values. Replace all <ctype.h> uses with our own custom mp_is*() functions added with misc/ctype.h. As a bonus, these functions are locale-independent. (Although currently, we _require_ C locale for other reasons.)
* options: add --list-protocols optionGravatar Alessandro Ghedini2014-06-30
|
* Basic xdg directory implementationGravatar Kenneth Zhou2014-06-26
| | | | | | | | | | Search $XDG_CONFIG_HOME and $XDG_CONFIG_DIRS for config files. This also negates the need to have separate user and global variants of mp_find_config_file() Closes #864, #109. Signed-off-by: wm4 <wm4@nowhere>
* stream: add a file cacheGravatar wm42014-06-22
| | | | | | | | | For remarks, pretty much see the manpage additions. Could help with network streams that require too much seeking (maybe), or might be extended to help with the use case of watching and downloading a file at the same time. In general, it might be a useless feature and could be removed again.
* stream: minor cleanupsGravatar wm42014-06-22
| | | | | Remove unused stream type constants. Move some now DVD specific crap to stream_dvd.c.
* stream_dvd, stream_dvdnav: map dvd:// to dvdnavGravatar wm42014-06-20
| | | | The old stream_dvd.c implementation is still available under dvdread://.
* stream_dvd: fix potential endless loop on seekingGravatar wm42014-06-20
| | | | | Attempt to fix a reported freeze with some DVDs. Unknown if this helps, and it still might read the whole DVD before terminating.
* cache: avoid race condition between cache wakeup and idlingGravatar wm42014-06-16
| | | | | | | | | | When the reader is out of data, it tries to wake up the cache thread to get more data. In theory, there's a small race condition, which could cause the cache to miss the wakeup and idle before reaction. Most certainly didn't cause real issues, because even if this extremely unlikely race condition happens, the cache won't idle for longer than 1 second (the hardcoded cache idle time).
* tv: if timestamp is unset, return NOPTSGravatar wm42014-06-14
| | | | | | Well, not sure if this really improves anything, but at least it's less of a WTF to the playback core than always returning the same timestamp for every frame.
* tv: remove some non-senseGravatar wm42014-06-14
| | | | | | There's really no need to convert this to float and then back. This is mostly of cosmetic nature, double precision was probably enough to avoid rounding.
* tv: fix compilation without clock_gettime, don't claim to be MPlayerGravatar wm42014-06-14
| | | | mp_msg() doesn't exist anymore in this form. Oops.
* tv: add missing header for clock_gettimeGravatar wm42014-06-13
| | | | | | | Not sure how this symbol becomes visible in glibc (probably accidental or mandatory recursive inclusion via the other standard or Linux- specific headers), but normally this include file is needed to get the symbol.
* cache: print cache size only in verbose modeGravatar wm42014-06-12
| | | | Seems pretty useless in general, so this reduces output noise.
* tv: fix a hidden static variableGravatar wm42014-06-12
|
* stream_bluray: fix some const declarationsGravatar wm42014-06-12
| | | | Like in commit 99f5fe.
* tv: use correct timestampsGravatar iive2014-06-12
| | | | | | | | | | | | | | | | | | Squashed from the following mplayer-svn commits. The '#' is removed from the bug ID to prevent github from doing something stupid. Instead of adding the mplayer configure check for clock_gettime(), the POSIX identifiers are used for checking presence of the function. Use correct type of timestamps when recording from v4l2. Fix 2176 Patch by Jarek Czekalski <jarekczek at poczta onet pl>. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@37222 b3059339-0415-0410-9bf9-f77b7e298cf2 Allow building of v4l2 without clock_gettime(). Add overly verbose message in case monotone timestamps are required by the kernel. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@37223 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add more constGravatar wm42014-06-11
| | | | | | | While I'm not very fond of "const", it's important for declarations (it decides whether a symbol is emitted in a read-only or read/write section). Fix all these cases, so we have writeable global data only when we really need.
* stream_dvd: minor cleanupsGravatar wm42014-06-11
| | | | | We don't need a separate stream_dvd.h header file anymore. Some dead functions become apparent; remove them.
* stream_dvd, stream_dvdnav, stream_bluray: remove global option variablesGravatar wm42014-06-11
|
* stream_dvb: remove global option variablesGravatar wm42014-06-11
|
* stream_cdda: remove global option variablesGravatar wm42014-06-11
|
* stream: add a generic way to setup stream priv defaultsGravatar wm42014-06-11
| | | | | | | | | | | | | | | Usually, each stream driver declares the size and option list of its private data. This was pretty natural for when most streams still used global variables to setup their defaults. They did by pointing priv_defaults to the (mutable) struct containing the option values. But falls short when storing the option values in MPOpts. So provide a somewhat inelegant but simple way to let the stream implementation setup the priv struct at initialization time. This is done with the get_defaults callback. It should return a copy of the struct used in MPOpts. (A copy, because if MPOpts is changed, string fields might be deallocated, and if that field is not described by stream_info.options, it won't be copied on init.)
* stream_pvr: remove global option variablesGravatar wm42014-06-11
|
* tv: remove printing of useless comment informationGravatar wm42014-06-11
|
* tv: remove global option variablesGravatar wm42014-06-11
| | | | | | Pretty much nothing changes, but using -tv-scan with suboptions doesn't work anymore (instead of "-tv-scan x" it's "-tv scan-x" now). Flat options ("-tv-scan-x") stay compatible.
* command: redo ancient TV/DVB/PVR commandsGravatar wm42014-06-11
| | | | | | | | | | | | | | | | | | Convert all these commands to properties. (Except tv_last_channel, not sure what to do with this.) Also, internally, don't access stream details directly, but dispatch commands with stream ctrls. Many of the new properties are a bit strange, because they're write- only. Also remove some OSD output these commands produced, because I couldn't be bothered to port these. In general, this makes everything much cleaner, and will also make it easier to e.g. move the demuxer to its own thread. Don't bother updating input.conf, but changes.rst documents how old commands map to the new ones. Mostly untested, due to lack of hardware.
* stream/cache: handle failure of seeking underlying streamGravatar wm42014-06-05
| | | | | | | | | | | | This could for example happen when serving an incomplete file from http, and the demuxer tries reading data from the end of the file when opening it (e.g. with avi). Seeking past EOF fails with http, so the file could never be opened, and the cache would get stuck trying to seek to the position. We can't really make the cache report seek failure directly (it would suck for various reasons), so just make the cache report EOF if seeking fails.
* stream: remove VCD supportGravatar wm42014-06-01
| | | | | | | | | If a single person complains, I will readd it. But I don't expect that this will happen. The main reason for removing this is that it's some of the most unclean code remaining, it's unmaintained, and I've never ever heard of someone using it.
* tv: remove sysinfo() usageGravatar wm42014-05-30
| | | | | | This call was used limited the buffer size if installed RAM was below 16 MB. This stopped being useful a decade ago. The check could also overflow on 32 bit systems. Just get rid of it.
* af_fmt2bits: change to af_fmt2bps (bytes/sample) where appropriateGravatar Marcoen Hirschberg2014-05-28
| | | | | | In most places where af_fmt2bits is called to get the bits/sample, the result is immediately converted to bytes/sample. Avoid this by getting bytes/sample directly by introducing af_fmt2bps.
* audio: rename i_bps to 'bitrate' to avoid confusionGravatar Marcoen Hirschberg2014-05-28
| | | | Since i_bps now contains bits/sec, rename it to reflect this change.
* audio: change values from bytes-per-second to bits-per-secondGravatar Marcoen Hirschberg2014-05-28
| | | | | | | The i_bps members of the sh_audio and dev_video structs are mostly used for displaying the average audio and video bitrates. Keeping them in bits-per-second avoids truncating them to bytes-per-second and changing them back lateron.
* stream: unbreak writeable streamsGravatar wm42014-05-27
| | | | | | | | | So, basically this worked only with streams that were not local files, because stream_dvd.c "intercepts" local files to check whether they point to DVD images. This means if a stream is not writeable, we have to try the next stream implementation. Unbreaks 2-pass encoding.
* stream_cdda: fix compilationGravatar wm42014-05-24
| | | | See previous commit. Sigh...
* stream_smb: fix compilationGravatar wm42014-05-24
| | | | Accidentally forgotten in commit a4d487.
* stream_file: readjust some windows ifdefferyGravatar wm42014-05-24
| | | | | | | | | | Also sneak in some cosmetics. setmode() exists on Windows/msvcrt only, so there's no need for a config test. I couldn't reproduce the problem with seekable pipes on wine, so axe it. (I'm aware that it still could be an issue on real Windows.)
* stream: remove chaos related to writeable streamsGravatar wm42014-05-24
| | | | | | | | | | For some reason, we support writeable streams. (Only encoding uses that, and the use of it looks messy enough that I want to replace it with FILE or avio today.) It's a chaos: most streams do not actually check the mode parameter like they should. Simplify it, and let streams signal availability of write mode by setting a flag in the stream info struct.
* stream_lavf: remove redundant message prefixesGravatar wm42014-05-24
|