summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* stream: fix bad cache behavior introduced by recent commitwm42013-05-051-1/+8
| | | | | | | | | | | | | | | | | | | | | | | Commit 4d14a42, a seemingly harmless change, introduced very bad cache behavior when the cache isn't forked, such as on Windows, where it uses threads. Apparently the cache code was designed for forking, and an unknown obscure condition causes severe performance degradation if a STREAM_CTRL is sent to the cache on every frame. Since the cache code is literally insane (uses shared memory + fork(), and has hacks to make it work with threads, is messed into the stream code in extra-hacky ways), we just fix it by caching the STREAM_CTRL in question. This is also done for some other STREAM_CTRLs that are called on each frame, such as playback duration. This indicates that the cache code has some inherent problem with answering such requests in a timely matter, and that there's no easy way around this. (Even if the cache is eventually rewritten, these things will probably have to be cached, otherwise you'd have to forcibly block until the stream implementation is done with a blocking read. The real question is why it worked fine with the forked cache, though.)
* core: add playback resume feature (manual/opt-in)wm42013-05-0514-1/+177
| | | | | | | | | | | | | | | | | | | | | | | | | A "watch later" command is now mapped to Shift+Q. This quits the player and stores the playback state in a config file in ~/.mpv/watch_later/. When calling the player with the same file again, playback is resumed at that time position. It's also possible to make mpv save playback state always on quit with the --save-position-on-quit option. Likewise, resuming can be disabled with the --no-resume-playback option. This also attempts to save some playback parameters, like fullscreen state or track selection. This will unconditionally override config settings and command line options (which is probably not what you would expect, but in general nobody will really care about this). Some things are not backed up, because that would cause various problems. Additional subtitle files, video filters, etc. are not stored because that would be too hard and fragile. Volume/mute state are not stored because it would mess up if the system mixer is used, or if the system mixer was readjusted in the meantime. Basically, the tradeoff between perfect state restoration and complexity/fragility makes it not worth to attempt to implement it perfectly, even if the result is a little bit inconsistent.
* command: alias video/audio/sub properties to -vid/-aid/-sidwm42013-05-051-9/+26
| | | | | | | | | Now vid/aid/sid can be used as properties. video/audio/sub still work, but they are aliases for the "real" properties. This guarantees that options/properties use the same value range. One consequence is that the video/audio/sub properties return "no" as value if no track is selected instead of -1.
* mplayer: factor config dir creationwm42013-05-051-18/+23
| | | | Move it into its own function.
* demux: use talloc for packetswm42013-05-051-15/+19
| | | | No functional change.
* core: ignore backstep command if demuxer is not capablewm42013-05-052-4/+9
| | | | | | Also, mark demuxer as not capable if DVD playback is done. The problem with DVD is that playback time (stream_pts) is not reported frame-exact, and the time is a "guess" at best.
* options: correctly handle things like: dvd://1-2/filenamewm42013-05-051-7/+9
| | | | | The "/filename" part was silently dropped when a range of titles is specified.
* demux_lavf: use demuxer ID for transport streamswm42013-05-051-1/+4
| | | | | Might help mapping tracks correctly to stream_bluray, fixing the issue with the track language not being reported.
* demux: use demux_lavf instead of demux_mpg for DVD playbackwm42013-05-051-1/+1
| | | | | | | | | | With the commit "demux_lavf: fix DEMUXER_CTRL_RESYNC", DVD playback seems to work nicely with demux_lavf, and maybe works even better than with demux_mpg. The old demuxer can be forced with: --demuxer=mpegps If no regressions surface, demux_mpg.c will be deleted later.
* demux_lavf: fix DEMUXER_CTRL_RESYNCwm42013-05-051-1/+1
| | | | | | | | | This used the libavformat current position, instead of the mp stream (which reflects current DVD/Bluray read position). This was broken, because libavformat won't update its position by calling the user's stream callbacks, negating the whole point of DEMUXER_CTRL_RESYNC. Now DVD playback with libavformat seems to work relatively well.
* demux_lavf: set stream_ptswm42013-05-051-0/+6
| | | | | | | | demux_mpg did the same, and doing this in demux_lavf fixes DVD playback when using this demuxer. Additionally this might make bluray work better in the future (but for now, bluray playback doesn't change as it doesn't report stream PTS yet).
* demux: report stream time info instead of demuxer info if possiblewm42013-05-051-4/+7
| | | | | Needed for bluray and dvd. demux_mpg (used for dvd playback) did this manually for the time length.
* stream: add start time reportingwm42013-05-053-0/+9
| | | | | | Will be needed to override the demuxer's start time reporting. We could be lazy and special-case it since the result is always 0 for the streams that care, but doing it properly is better.
* core: move demuxer time reporting to demuxerwm42013-05-053-8/+25
|
* core: don't report byte-based playback position with dvdwm42013-05-055-1/+22
| | | | | | | | | | DVD playback uses a demuxer that signals to the frontend that timestamp resets are possible. This made the frontend calculate the OSD playback position based on the byte position and the total size of the stream. This actually broke DVD playback position display. Since DVD reports a a linear playback position, we don't have to rely on the demuxer reported position, so disable this functionality in case of DVD playback. This reverts the OSD behavior with DVD to the old behavior.
* csputils: use AVCOL_SPC_YCOCG instead of AVCOL_SPC_YCGCO (fixes Libav build)wm42013-05-051-2/+2
| | | | | | | | This one should probably be blamed on ffmpeg. Its headers contain: #define AVCOL_SPC_YCGCO AVCOL_SPC_YCOCG Uh, ok...
* manpage: fix option descriptionwm42013-05-051-1/+1
|
* video: add --hwdec-codecs option to whitelist codecs for hw decodingwm42013-05-045-3/+32
|
* vd_lavc: allow explicitly selecting vdpau hw decoderswm42013-05-041-1/+11
| | | | | | | | | | | | This allows using the vdpau decoders with -vd without having to use the -hwdec switch (basically like in mplayer). Note that this way of selecting the hardware decoder is still deprecated. libavcodec went away from adding special decoder entries for hardware decoding, and instead makes use of the "hwaccel" architecture, where hardware decoders use the same decoder names as the software decoders. The old vdpau special decoders will probably be deprecated and removed in the future.
* video: support YCgCo colorspacewm42013-05-043-1/+15
| | | | | | | YCgCo can be manually selected, but will also be used if the decoder reports YCgCo. To make things more fun, files are sometimes marked incorrectly, which will display such broken files incorrectly starting with this commit.
* vo_opengl: XYZ input supportwm42013-05-044-12/+70
| | | | | | | | | | | | | | | | Useful for the j2k decoder. Matrix taken from http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html (XYZ to sRGB, whitepoint D65) Gamma conversion follows what libswscale does (2.6 in, 2.2 out). If linear RGB is used internally for scaling, the gamma conversion will be undone by setting the exponent to 1. Unfortunately, the two gamma values don't compensate each others exactly (2.2 vs. 1/0.45=2.22...), so output is a little bit incorrect in sRGB or color-managed mode. But for now try hard to match libswscale output, which may or may not be correct.
* video: fix setting XYZ flagwm42013-05-041-4/+4
| | | | Commit 9e0b68a didn't really do this correctly, failure at basic logic.
* gl_video: use GL_SRGB only if it's really RGBwm42013-05-041-2/+3
| | | | | Use the proper RGB flag instead of !YUV. Currently, this doesn't change anything, because only RGB and YUV formats are supported.
* stream: remove unused new_ds_stream()wm42013-05-032-13/+0
|
* vf_rotate: fix for some obscure pixel formatswm42013-05-031-7/+6
| | | | | Repurpose the 3 byte case for any unhandled pixel width. Fixes rotation with e.g. rgb48. Very inefficient, but works.
* wayland: fix wrong poll comment, check for errorsAlexander Preisinger2013-05-021-2/+4
| | | | | | | | We only print an error message when POLLERR or POLLHUP occurrs, as the something did go horribly wrong and the server will either deal with it or crash. Also add POLLOUT to the events.
* wayland: avoid iterating over all outputsAlexander Preisinger2013-05-021-15/+18
| | | | | If we use the output itself as user data we don't have to iterate over all outputs when the handle_mode event comes.
* wayland: remove unused stuffAlexander Preisinger2013-05-022-17/+0
|
* wayland: use new function xkb_keymap_from_bufferAlexander Preisinger2013-05-022-10/+6
| | | | | | Bump xkbcommon version and use the new xkb_keymap_from_buffer. This is more secure, because the from_string expects a 0 terminated string, but this cannot be guaranteed with mmap.
* Fix compilation with Libavwm42013-05-011-1/+1
|
* video: add XYZ supportwm42013-05-014-0/+19
| | | | Needed for the ffmpeg j2k decoder.
* wayland: remove input modifier variableAlexander Preisinger2013-05-012-14/+0
| | | | This variable was never used anywhere.
* wayland: use GetTimerMS for hiding mouse cursorAlexander Preisinger2013-05-012-161/+39
| | | | | | This commit remove a lot of linux specific code, like epoll. It also reduces the complexity of the code. Instead of epoll we use poll which makes the wayland backend more portable to other platforms.
* wayland: use mpv internal key auto-repeat handlingAlexander Preisinger2013-05-012-61/+5
| | | | | | This removes a good chunk of code trying to recreate key repeat. Because the wayland protocol and xkbcommon don't have an interface for auto-repeating pressed keys.
* subreader: fix out of bound write access when parsing .srtwm42013-04-301-4/+4
| | | | | | | | | | | | | | | | | | This broke .srt subtitles on gcc-4.8. The breakage was relatively subtle: it set all hour components to 0, while everything else was parsed successfully. But the problem is really that sscanf wrote 1 byte past the sep variable (or more, for invalid/specially prepared input). The %[..] format specifier is unbounded. Fix that by letting sscanf drop the parsed contents with "*", and also make it skip only one input character by adding "1" (=> "%*1[..."). The out of bound write could easily lead to security issues. Also, this change makes .srt subtitle parsing slightly more strict. Strictly speaking this is an unrelated change, but do it anyway. It's more correct.
* demux: simplify stream ID business, fix issue with cover artwm42013-04-293-17/+9
| | | | | | | | | | | The stream ID handling as it was changed in commit 654c34f was still a little bit insane, and caused a regression with the cover art hack (the stream set in demux->video->sh was incorrect for demux_lavf). Simplify by always using stream_index for demux_stream->id, and getting rid of that tid thing. It turns out that the id for subtitles isn't special either (maybe demux_ts.c was the only thing left that required this).
* encoding: fix final audio frame syncRudolf Polzer2013-04-281-10/+22
| | | | | When --ocopyts was used, the final audio frame got improper pts. Fixed by now using the play() logic to play the final frame too.
* cocoa_common: fix window sizingStefano Pigozzi2013-04-281-2/+2
| | | | | | The code was attempting to get the ceiling of the double. Too bad NSSize has floats inside of it and the int cast is nowhere to be seen. This caused rounding errors by one pixel in the window size.
* subassconverter: silence clang warningStefano Pigozzi2013-04-281-1/+1
|
* osd: convert OSD font to OpenTypewm42013-04-273-1/+1
| | | | | | | | | | | | | | | | | | The old OSD font was a PostScript Type 1 font. Convert it to OpenType to work around a fontconfig bug [1]. OpenType is a more modern format, and the font file is quite a bit smaller, so this is actually a nice change. The conversion was done by opening the font with fontforge and saving it as OpenType (CFF). fontforge showed a warning when doing this: The font contains errors. Self Intersecting Bad Private Dictionary These seem to be harmless. [1] https://bugs.freedesktop.org/show_bug.cgi?id=63922
* stream_bluray: remove the broken -bluray-chapter optionreimar2013-04-274-22/+2
| | | | | | | | | | Remove the broken -bluray-chapter option. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@36175 b3059339-0415-0410-9bf9-f77b7e298cf2 Conflicts: DOCS/man/en/mplayer.1 cfg-common.h
* stream_bluray: fix querying current chapterreimar2013-04-271-3/+1
| | | | | | | | | br://: Fix querying current chapter. This also fixes specifying an end chapter via -chapter. Based on patch by Olivier Rolland [billl users.sourceforge.net] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@36173 b3059339-0415-0410-9bf9-f77b7e298cf2
* mplayer: put space before encoding part of status linewm42013-04-271-1/+1
| | | | Also, the trailing space isn't needed.
* demux_mkv: fix segfault issue playing back VC1 in a mkvBin Jin2013-04-271-1/+1
| | | | This bug was introduced in commit 06eee1b.
* vd_lavc: fix decoder init failure pathwm42013-04-271-14/+18
| | | | | | | | | libavcodec decoder initialization failure caused a segfault, because it wasn't properly reported back in init(). Also remove the return value from init_avctx(), which actually makes things simpler. Instead, ctx->avctx can be checked to see whether initialization was ok.
* compat: remove an unused symbolwm42013-04-261-4/+0
| | | | | The compatibility issue actually didn#t get solved, it's just handled differently in mpv now.
* subassconvert: do not escape likely ASS override tagswm42013-04-261-1/+19
| | | | | | | | | | | | | | | | | | | | | | | Usually SubRip files are not expected to contain ASS override tags, but unfortunately these files seem to become more common. Example from a real file: 1 00:00:00,800 --> 00:00:15,000 {\an8}本字幕由 {\c&H26F4FF&}ShinY {\c&HFFAE1A&}深影字幕组{\c&HFFFFFF&} 原创翻译制作 subassconvert.c escaped '{', so that libass displayed the above line literally. Try to apply a simple heuristic to detect whether '{' is likely to start an ASS tag: if the string starts with '{\', and there is a closing '}', assume it's an ASS tag, otherwise escape the '{' properly. If it's a likely ASS tag, it's passed through to libass. The end result is that the above script is displayed in color, while at the same time legitimate uses of '{' and '}' should work fine. We assume that nobody uses {...} for commenting text in SubRip files. (This kind of comment is popular and legal in ASS files, though.)
* manpage: fix references to --slavewm42013-04-261-2/+2
|
* options: allow using [ ] for quoting in sub-optionswm42013-04-262-7/+21
| | | | | | This is an attempt to make quoting of sub-option values less awkward, even if it works only with some shells. This is needed mainly for vf_lavfi. Also update the vf_lavfi manpage section.
* vf_lavfi: move compat crap to the start of the filewm42013-04-261-18/+18
|
* vf_lavfi: silence stupid deprecation warningwm42013-04-261-2/+12
| | | | | | | | | | | | | | | | | | | libavfilter changed the way a format list is passed to vf_format. Now you have to separate formats with "|" instead of ":". If you use "|", it prints an annoying message on every reinit: [format @ 0x8bbaaa0]This syntax is deprecated. Use '|' to separate the list items. ...and it will probably stop working without warning at some point in the future. We need some very annoying ifdeffery to detect this case, because libavfilter version numbers are just plain incompatible between Libav and ffmpeg. There is no other way to detect this. (Sometimes I wonder whether ffmpeg and especially Libav actually like causing unnecessary pain for their users, and intentionally break stuff in the most annoying way possible. Sigh...)
* core: simplify handling of --pausewm42013-04-255-31/+21
| | | | | | | | | | | | | Rename the struct MPOpts "start_pause" field to "pause". Store the user- pause state in that field, so that both runtime pause toggling and the --pause switch change the same variable. Simplify the initialization of pause so that using --pause and changing the file while paused is exactly the same case (changing the file while paused doesn't unpause, this has been always this way). Also make it a bit more consistent. Before, starting with --pause would reset the pause state for every file, instead of following the usual semantics for option switches (compare with behavior of --fs).
* core: don't let cache pause handling and user pausing conflictwm42013-04-253-10/+25
| | | | | | | | | | | | The core pauses and unpauses automatically to wait for the network cache (also known as buffering). This conflicted with user pause control, and was perceived as if the player was unresponsive and/or the cache just overturned the user's decisions. Change it so that the actual pause state and the pause state as intended by the user never conflict. If the user toggles pause, the pause state will be in the expected state as soon as the cache is loaded.
* vf_lavfi: recreate filter graph on seekwm42013-04-251-14/+41
| | | | | | | | | | | | | | Resetting the filter graph helps dealing with filters which save state between frames. This is important especially if they modify frame timing or emit additional frames. Unfortunately the libavfilter API doesn't have a way to do this directly, so we have to use a dirty trick: we recreate the whole graph, including format negotiation down and filter string parsing. ffplay does this too. If libavfilter somehow decides to change output format or size from what the first run in config() returned, mpv will explode. The same applies to vf_next_query_format() return values (although this could be mitigated, should it really happen).
* core: fix bogus condition that broke backstepping with last commitwm42013-04-251-1/+1
| | | | | This broke all cases where indexing was required, and the current frame wasn't the first frame in a segment.
* core: fix backstepping with ordered chapterswm42013-04-251-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | There were two problems. First, frames past the end of the current segment were added to the index, which messed up backstepping. Check for the endpts before added a frame to the index. Second, it wasn't possible to step over segments which change the file. Changing a file causes decoder reinitialization, which (rightfully) is treated as discontinuity (and vo_pts_history_seek_ts was changed). Add some extra code to pretend that a segment-switching seek/reinit does not introduce discontinuities. There's still a weird corner case: sometimes, you can frame step forward on the last frame of a segment without reaching the next segment immediately. This is because the playloop switches into audio-only mode. The segment is switched when both audio and video have ended, so the frame stepping will play random sized chunks of audio until the segment will be switched. This gives the impression that backstepping doesn't work perfectly, even though it's the other way around and frame stepping behaves weird. This is a consequence of wanting to make frame stepping work with audio, and is not really a bug.
* manpage: remove broken examplewm42013-04-241-3/+0
| | | | Weird video size presets have been removed.
* manpage: document --native-keyrepeatwm42013-04-241-0/+6
| | | | Forgotten in commit d853aba.
* demux_mkv: cosmeticswm42013-04-241-4/+3
|
* core: add backstep supportwm42013-04-247-8/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows stepping back one frame via the frame_back_step inout command, bound to "," by default. This uses the precise seeking facility, and a perfect frame index built on the fly. The index is built during playback and precise seeking, and contains (as of this commit) the last 100 displayed or skipped frames. This index is used to find the PTS of the previous frame, which is then used as target for a precise seek. If no PTS is found, the core attempts to do a seek before the current frame, and skip decoded frames until the current frame is reached; this will create a sufficient index and the normal backstep algorithm can be applied. This can be rather slow. The worst case for backstepping is about the same as the worst case for precise seeking if the previous frame can be deduced from the index. If not, the worst case will be twice as slow. There's also some minor danger that the index is incorrect in case framedropping is involved. For framedropping due to --framedrop, this problem is ignored (use of --framedrop is discouraged anyway). For framedropping during precise seeking (done to make it faster), we try to not add frames to the index that are produced when this can happen. I'm not sure how well that works (or if the logic is sane), and it's sure to break with some video filters. In the worst case, backstepping might silently skip frames if you backstep after a user-initiated precise seek. (Precise seeks to do indexing are not affected.) Likewise, video filters that somehow change timing of frames and do not do this in a deterministic way (i.e. if you seek to a position, frames with different timings are produced than when the position is reached during normal playba