summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* x11: fix initial state for --on-all-workspaceswm42015-01-171-0/+6
|
* cocoa: fix fullscreen handlingwm42015-01-171-2/+3
| | | | Fixes #1483, if it even compiles.
* x11: add --on-all-workspaces option and propertywm42015-01-167-3/+33
| | | | Fixes #1469.
* x11: minor cleanupwm42015-01-161-18/+4
| | | | No reason for these functions to exist separately...
* command: unify handling of fullscreen and other VO flagswm42015-01-166-21/+19
| | | | | | | | The "ontop" and "border" properties already used a common mp_property_vo_flag() function, and the corresponding VOCTRLs used the same conventions. "fullscreen" is pretty similar, but was handled slightly similar. Change how VOCTRL_FULLSCREEN behaves, and use the same helper function for "fullscreen" as the other flags.
* player: add --autofit-smaller optionwm42015-01-164-5/+22
| | | | | | | | Fixes #1472. (Maybe these options should have been named --autofit-max and --autofit-min, but since --autofit-larger already exists, use --autofit-smaller for symmetry.)
* demux: return EOF when reading from unselected streamwm42015-01-161-1/+1
| | | | | | | | | | | | | | | | | Normally the player doesn't read from unselected streams, so this should be a no-op. But unfortunately, some broken files can severely confuse the player, and assign the same demuxer stream to multiple front-end tracks. Then selecting one of the tracks would deselect the other track, with the end result that the demuxer stream for the selected track is deselected. This could happen with mkv files that use the same track number (which is of course broken). timeline_set_part() sets the tracks using demuxer_stream_by_demuxer_id(), using the broken non-unique IDs. The observable effect was that the player never quit, because demux_read_packet_async() told the caller to wait some longer for new packets. Fix by returning EOF instead. Fixes #1481.
* player: don't enable demuxer readahead before selecting trackswm42015-01-162-5/+6
| | | | | | | | | | This is for the ordered chapters case only. In theory this could have resulted in initial audio, video or subs missing, although it didn't happen in practice (because no streams were selected, thus the demuxer thread didn't actually try to read anything). It's still better to make this explicit. Also, timeline_set_part() can be private to loadfile.c.
* cocoa: don't set application icon in libmpvStefano Pigozzi2015-01-161-2/+4
|
* player: respect --untimed on last framewm42015-01-162-3/+4
| | | | | | | | | | | | | | The last video frame is another case that has a separate code path, although it's pretty similar to the one in commit 73e5aa87. Fix this in a different way, which also takes care of the last frame case, although without context the code becomes slightly more tricky. As further cleanup, move the decision about framedropping itself to the same place, so the check in vo.c becomes much simpler. The check for the vo->driver->encode flag, which is remvoed completely, was redundant too. Fixes #1480.
* subprocess-win: Always quote argv[0]James Ross-Gowan2015-01-161-3/+5
| | | | | | | | | | | | | If the program name isn't quoted and the .exe it refers to isn't found, CreateProcess will add the program arguments to the program name and continue searching, so for "program arg1 arg2", CreateProcess would try "program.exe", "program arg1.exe", then "program arg1 arg2.exe". This behaviour is weird and not really desirable, so prevent it by always quoting the program name. When quoting argv[0], escape sequences shouldn't be used. msvcrt, .NET and CommandLineToArgvW all treat argv[0] literally and end it on the trailing quote, without processing escape sequences.
* manpage: fix osd-ass-cc exampleswm42015-01-161-1/+4
| | | | | | | | The "\\" escape was rendered as "\" on the website. I'm hoping quoting this in ``...`` will render it correctly. Also add an example for show_text, which awkwardly does not require escaping the "\".
* player: respect --untimed on video format changeswm42015-01-161-1/+1
| | | | | | | | | | | If the video format changes (e.g. different frame size), a special code path is entered to wait until the currently displayed frame is done. Otherwise, the frame before the change would be destroyed by the vo_reconfig() call. This code path didn't respect --untimed; correct this. Fixes #1475.
* win32: make sure __STRICT_ANSI__ is not definedJames Ross-Gowan2015-01-161-2/+2
| | | | | | | __STRICT_ANSI__ disables functions and definitions that aren't in ANSI C. Unfortunately this includes j1(), which is used by the new ewa_lanczos code. Cygwin's CFLAGS already unset __STRICT_ANSI__, but it should be unset for both Cygwin and MinGW.
* ytdl_hook: Check for empty playlistsChrisK22015-01-161-1/+7
| | | | | Sometimes we get empty playlists back, print a warning message instead of crash
* OSC: Reset all styles for idle messageChrisK22015-01-161-6/+6
|
* vo_opengl: get rid of approx-gamma and make it the default as per BT.1886Niklas Haas2015-01-164-66/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | After finding out more about how video mastering is done in the real world it dawned upon me why the "hack" we figured out in #534 looks so much better. Since mastering studios have historically been using only CRTs, the practice adopted for backwards compatibility was to simulate CRT responses even on modern digital monitors, a practice so ubiquitous that the ITU-R formalized it in R-Rec BT.1886 to be precisely gamma 2.40. As such, we finally have enough proof to get rid of the option altogether and just always do that. The value 1.961 is a rounded version of my experimentally obtained approximation of the BT.709 curve, which resulted in a value of around 1.9610336. This is the closest average match to the source brightness while preserving the nonlinear response of the BT.1886 ideal monitor. For playback in dark environments, it's expected that the gamma shift should be reproduced by a user controlled setting, up to a maximum of 1.224 (2.4/1.961) for a pitch black environment. More information: https://developer.apple.com/library/mac/technotes/tn2257/_index.html
* player: don't fall asleep on audio decoding errorswm42015-01-151-0/+2
| | | | | | This makes it retry later. Fixes #1474.
* manpage: changes.rst: document vo_opengl's placebo featuresNiklas Haas2015-01-151-1/+5
|
* vo_opengl: add ewa_lanczos upscaler (aka jinc)Niklas Haas2015-01-155-30/+158
| | | | | This is the polar (elliptic weighted average) version of lanczos. This introduces a general new form of polar filters.
* player: fix --stop-playback-on-init-failure on audio init failurewm42015-01-151-2/+1
| | | | | | | This was forgotten when the option was implemented, and makes this option work as advertised. Fixes #1473 (though the default behavior is probably still stupid).
* af: remove old filter compatibility hackwm42015-01-152-42/+1
|
* audio/filter: switch remaining filters to refcountingwm42015-01-154-44/+58
| | | | | All of these filters are very similar in frame management, and copy data to a new frame during filtering.
* audio/filter: switch remaining in-place filters to refcountingwm42015-01-159-127/+134
| | | | | | | | | | | | | | | | | | Adds about 7 lines of boilerplate per filter. This could be avoided by providing a different entrypoint (something like af->filter_inplace), which would basically mirror the old interface exactly for this kind of filter. But I feel like it would just be a hack to support all those old, useless filters better. (The ideal solution would be using a language that can do closures to provide a compat. wrapper, but whatever.) af_bs2b has terribly repetitious code for setting up filter functions for each format (most of them useless, in addition to bs2b being useless), so I did something terrible with macros. af_sinesuppress had commented code for float filtering (maybe it was broken; it has been commented every since it was added in 2006). Remove this code.
* af: verify filter input formatswm42015-01-151-1/+4
| | | | | | | | | | | Just to make sure all filters get the correct format. Together wih the check in af_add_output_frame(), this asserts that af->prev->fmt_out == af->fmt_in This also requires setting the "in" pseudo-filter (s->first) formats correctly. Before this commit, the fmt_in/fmt_out fields weren't used for this filter.
* vo_opengl_cb: initial screenshot supportwm42015-01-151-0/+10
| | | | | | | | | | | Support for taking screenshots when doing hardware decoding needs to be added later. This takes the last image queued to the VO, which is logically the image the player thinks is on screen (so e.g. subtitles will match). forget_frames() does not clear this, because seeking does not remove the current image from the screen (until the next one is drawn).
* image_writer: check for conversion errorswm42015-01-153-11/+17
| | | | | This can happen when e.g. a VO returns a screenshot in an unsupported format.
* osc: fix disabling OSCwm42015-01-151-1/+5
| | | | | | | Upon the "DEL" key binding or the "disable-osc" message, the OSC should stay permanently invisible. This was recently broken (not sure by what), because other code accidentally reenables it anyway, which resulted in the OSC appearing again when moving the mouse.
* DOCS/client_api_examples: fix locale nonsense in qml exampleswm42015-01-152-0/+10
| | | | | | | The Qt example already does this. I hoped this was restricted to QApplication only, but apparently Qt repeated this mistake with QGuiApplication (QGuiApplication was specifically added for QtQuick at a much later point, even though QApplication inherits from it).
* ao_alsa: fix a small memory leakwm42015-01-141-0/+2
|
* af_lavcac3enc: use refcounted frameswm42015-01-141-89/+95
|
* af_lavfi: use refcounted frameswm42015-01-141-44/+57
|
* audio/filter: actually set fmt_in/fmt_out fieldswm42015-01-141-0/+2
|
* af_scaletempo: use refcounted frameswm42015-01-141-11/+23
|
* af_lavrresample: use refcounted frameswm42015-01-141-23/+46
|
* audio: add missing declarationwm42015-01-141-0/+1
|
* ao_pcm: add append modewm42015-01-142-1/+7
| | | | | Pretty useful for debugging, although a bit useless or possibly misleading too (see comments in the manpage).
* audio: fix initial audio PTSwm42015-01-141-24/+25
| | | | | | | | | | Commit 5e25a3d2 broke handling of the initial frame (the one decoded with initial_audio_decode()). It didn't update the pts_offset field, leading to a shift in timestamps by one audio frame. Fix by calling the actual decode function in a single place. This requires slightly more changes than what would be necessary to fix the bug, but it also somewhat simplifies the data flow.
* player: fallback to seek time for percent-pos propertywm42015-01-141-2/+2
| | | | | | | | | | | | | The percent-pos property normally goes by time, except for file formats like .ts or .ogg, where you can't trust the timestamps and duration info to compute the position in the overall files. These use the byte position and size instead. When the file position was unavailable (e.g. due to an ongoing seek), the percent-pos was unknown. Change it to use the time position instead. In most cases, it's actually accurate enough, and the temporary unavailability of the property can be annoying, e.g. on the terminal status line.
* audio: fix assertion failure on audio decodingwm42015-01-141-2/+2
| | | | | | | There are several cases in which a decoder may need several packets to produce some output audio. Commit 5e25a3d2 broke this. Fixes #1471.
* af_convert24: use refcounted frameswm42015-01-131-8/+13
| | | | | This requires allocating a fully new frame. 32->24 could be in-place, but this is not possible for 24->32.
* audio/filters: use refcounted frames for some in-place filterswm42015-01-133-7/+31
| | | | | These are also quite simple, but require requesting write access to the frames. The error handling (for OOM) is a bit annoying.
* audio/filters: use refcounted frames for some simple filterswm42015-01-134-10/+18
| | | | These are read-only, and very trivial to convert.
* af_volume: use refcounted frameswm42015-01-131-8/+15
|
* audio: use refcounted frames in the filter chainwm42015-01-133-77/+227
| | | | | | | | | | | | | | | | | | | The goal is switching the whole audio chain to using refcounted frames. This brings the architecture closer to FFmpeg, enables better integration with libavfilter, will reduce useless copying somewhat, and will probably allow better timestamp tracking. For now, every filter goes through a semi-awful wrapper in af_do_filter(), though. This will be fixed step by step, and the wrapper should eventually be removed. Another thing that will have to be done is improving the timestamp handling and avoiding extra copies for the AO. Some of the new code is rather similar to the video filter code (the core filter code basically just has types replaced). Such code duplication is normally very unwanted, but in this case there's probably no other choice. On the other hand, this code is pretty simple (even if somewhat tricky). Maybe there will be unified filter code in the future, but this is still far away.
* audio: add some utility functions for refcounted frameswm42015-01-132-10/+64
| | | | Used in the following commits.
* audio/filter: remove unused af_calc_filter_multiplier()wm42015-01-136-31/+2
| | | | | | | | | | | | The purpose of this function was to filter only as much audio input as needed to produce a certain amount of audio output. This could (in theory) avoid excessive buffering when e.g. changing playback speed with resampling. Use of this was already removed in commit 5fd8a1e0. No problems were experienced, so let's assume this feature is practically worthless. (Though it's possible that it was quite useful over a decade ago, or in some cornercases with evil files.)
* client API: fix log buffer overflow casewm42015-01-131-3/+3
| | | | | | | It just crashed. The prefix and text fields point to static strings in this case. Oops. Fixes the issue mentioned in #838.
* manpage: fix references to vf_ppwm42015-01-132-4/+3
| | | | | | It was removed, but is still available through FFmpeg. Fixes #1468.
* vf: make message less confusingwm42015-01-131-1/+1
| | | | | Well, probably still not very good, but now at least accounts for the case the decoder or a filter outputs nonsense values.
* mp_image: reject invalid display aspect ratiowm42015-01-131-1/+1
| | | | | | | | | | Having any of these set to 0 makes no sense. I think some code might still be using 0/0 aspect ratio to signal unset aspect ratio, but I didn't find it. If there is still code like this, it should be fixed instead. Fixes #1467.
* player: fix crash wtih --secondary-sidwm42015-01-131-2/+3
| | | | Fises #1463.
* cache: cache-position needs to be int64_tOliver Freyermuth2015-01-131-1/+1
| | | | | | Both max_filepos and offset are int64_t, so pos can overflow, e.g. causing endless loops in stream implementation.
* stream_dvb: Add MP_ERR if polling worked, but read fails.Oliver Freyermuth2015-01-131-0/+4
| | | | Read can still fail, e.g. if the buffer is invalid.
* wayland: implement key modifierswm42015-01-121-18/+24
| | | | Includes shift, ctrl, alt, meta.
* wayland: don't compute absurd window sizewm42015-01-121-3/+6
| | | | | | | | | For some reason, schedule_resize() can be called with everything set to 0. The code couldn't handle wl->window.aspect set to 0, converting NaNs to integers. Just work this around. (I have no idea what I'm doing. This is probably a corner case caused by my broken-ish wayland setup.)
* bstr: fix possible undefined behavior with length 0 stringswm42015-01-121-1/+1
| | | | | | | | | | BSTR_P() passes the string length and start pointer to printf-like functions. If the lenfth is 0, the pointer can be NULL, but we're actually still not allowed to pass a NULL pointer in any case. This is mostly a technically, because nobody in their right mind would attempt to specifically break such cases. But it's still undefined behavior, and some libcs might be strict about this.
* player: don't set tag strings to NULLwm42015-01-121-3/+3
| | | | | | | | | | | | | bstr is a bounded string type, consisting of a pointer and a length value. If the length is 0, the pointer can be NULL. This is somewhat logical due to how this abstraction works, but it can leak when converting to C strings. talloc_strndup() returns NULL instead of "" in this case, which broke some other code. Use bstrto0() instead, which is the "proper" function to convert bstr to char*. Fixes #1462.
* demux_mkv: fix EBML parsing checkswm42015-01-121-16/+15
| | | | | | | | Reading IDs must be checked too. This was basically forgotten in commit f3a978cd. Also set the *length parameter for ebml_parse_length() in some error cases, which _really_ should happen. Fixes #1461.
* manpage: improve --title descriptionwm42015-01-121-5/+6
| | | | | It might be rather surprising that --title also sets the audio stream title (for PulseAudio and wasapi), so it certainly should be mentioned.
* tl_matroska: fix minor memory leak in error casewm42015-01-121-5/+7
| | | | Going the way of least resistance. Fixes #1460.
* player: check sufficient track selection before destroying VOwm42015-01-121-9/+9
| | | | | | | | | | | | | | | | mpv needs at least an audio or video track to play something. If the track selection is basically insufficient, the player will immediately skip to the next file (or quit). One slightly annoying thing might be that trying to play a subtitle file will close the VO window, and then go to the next file immediately (so "mpv 1.mkv 2.srt 3.mkv" would flash the video window when 2.srt is skipped). Move the check to before the video window is possibly closed. This is a minor cosmetic issue; one can use --force-window to avoid closing the video window at all. Fixes #1459.
* client API: reasonable behavior if window is closedwm42015-01-121-0/+2
| | | | | | | | | | | | | | | | Closing the video window sends CLOSE_WIN, which is normally mapped to the "quit" command. The client API normally disables all key bindings, and closing the window does nothing. It's simply left to the application to handle this. This is fine - an embedded window can not be destroyed by user interaction. But sometimes, the window might be destroyed anyway, for example because the containing window is destroyed. If this happens, CLOSE_WIN should better not be ignored. We can't expect client API users to handle this specially (by providing their own input.conf), so provide some fallback for this pseudo key binding. The "quit" command might be too intrusive (not every client necessarily handles "unexpected" MPV_EVENT_SHUTDOWN), but I think it's still reasonable.
* x11: explicitly query map status when waiting for map eventwm42015-01-121-0/+6
| | | | | | | | For some reason, mpv sometimes does not get a MapNotify event with GtkSocket embedding. This happens maybe 1 out of 10 times. I'm not sure how this can happen - it certainly shouldn't. Since I was not able to find the cause, and causes an apparent "deadlock", here's a lazy hack to fix the misbehavior.
* x11: support XEmbedwm42015-01-122-6/+58
| | | | | | | | | | | | Seems to work with GtkSocket and passing the gtk_socket_get_id() value via "wid" option to mpv. One caveat is that using <tab> to move input focus from mpv to GTK does not work. It seems we would have to interpret <tab> ourselves in this case. I'm not sure if we really should do this - it would probably require emulating some other typical conventions too. I'm not sure if an embedder could do something about this on the toolkit level, but in theory it would be possible, so leave it as is for now.
* vo: don't synchronize when seekingwm42015-01-121-1/+7
| | | | | | | |