summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* demux_mkv: cosmeticswm42014-11-271-24/+13
|
* demux_mkv: fix a possible out of bounds accesswm42014-11-271-6/+8
| | | | | | | | | | | | | The if branch has a weak check to test whether the codec_id is the short ID, and handles the long IDs in the else branch. The long IDs are all longer than 12 bytes long, so hardcoding the string offset to get the trailing part of the name makes sense. But the if condition checks for another thing, which could get the else branch run even if the codec_id is short. Fix the bogus control flow and check if the codec_id is long enough. One of these checks could be considered redundant, but include them both for defensive coding.
* ao_wasapi: don't treat SetDisplayName() failure as fatalwm42014-11-271-1/+2
| | | | Same for SetIconPath().
* vo_direct3d: check whether D3DFMT_A8 is availablewm42014-11-271-11/+29
| | | | | | | | I suspect this is what is happening in github issue #1265 (at least partially). If D3DFMT_A8 is not available, fall back to RGBA. This is less efficient in general, so we normally want to avoid it.
* gl_video: minor simplificationwm42014-11-271-4/+0
| | | | Not needed anymore.
* command: sub_add with "auto" should not always select a subtitle trackwm42014-11-271-1/+3
| | | | | | | | | | | Running "sub_add file.srt auto" during hook execution automatically selected the first added track. This happened because all tracks added with sub_add are marked as "external", and external subtitles are always selected by default. Fix this by negating the "external" flag when autoselecting subtitles during loading. The no_default flag exists for this purpose; it was probably added for libquvi originally, where we had the same issue.
* audio: alternative fix for previous commitwm42014-11-271-4/+1
| | | | | | | This is a somewhat obscure situation, and happens only if audio starts again after it has ended (in particular can happens with files where audio starts later). It doesn't matter much whether audio starts immediately or some milliseconds later, so simplify it.
* audio: fix busy loop when seeking while pausedwm42014-11-271-2/+4
| | | | | | | | | | | | | | | | | | | | When playing paused, the amount of decoded audio is limited to a small amount (1 sample), because we don't write any audio to the AO when paused. The small amount could trigger the case of the wanted audio being too far in the future in the PTS sync code, which set the audio status to STATUS_DRAINING, which in turn triggered the EOF code in the next iteration. This was ok, but unfortunately, this triggered another retry in order to check resuming from EOF by setting the status to STATUS_SYNCING, which in turn lead to the busy loop by alternating between the 2 states. So don't try resyncing while paused. Since the PTS syncing code also calls ao_reset(), this could cause the pulseaudio daemon to consume some CPU time as well. This was caused by commit 33b57f55. Before that, the playloop was merely run more often, but didn't cause any problems. Fixes #1288.
* mixer: don't show softvol neutral marker on OSD if not using softvolwm42014-11-271-2/+2
| | | | Also fix the comment on the softvol field.
* vo_opengl: Linearize non-RGB sRGB files correctly (eg. JPEG)Niklas Haas2014-11-263-7/+48
| | | | Signed-off-by: wm4 <wm4@nowhere>
* Do not call strerror()wm42014-11-2616-90/+117
| | | | | | | | | | | | | | | | | | | | | | | | | ...because everything is terrible. strerror() is not documented as having to be thread-safe by POSIX and C11. (Which is pretty much bullshit, because both mandate threads and some form of thread-local storage - so there's no excuse why implementation couldn't implement this in a thread-safe way. Especially with C11 this is ridiculous, because there is no way to use threads and convert error numbers to strings at the same time!) Since we heavily use threads now, we should avoid unsafe functions like strerror(). strerror_r() is in POSIX, but GNU/glibc deliberately fucks it up and gives the function different semantics than the POSIX one. It's a bit of work to convince this piece of shit to expose the POSIX standard function, and not the messed up GNU one. strerror_l() is also in POSIX, but only since the 2008 standard, and thus is not widespread. The solution is using avlibc (libavutil, by its official name), which handles the unportable details for us, mostly. We avoid some pain.
* gl_common: factor context creationwm42014-11-264-50/+51
| | | | | | | Always create the context in mpgl_init(), instead of doing it when mpgl_config_window() is called the first time. This is a small step towards cleaning up the GL backend interface, and adding other things like perhaps GLES support, or a callback-driven backend for libmpv.
* vo_opengl: Reword comment in shaderNiklas Haas2014-11-261-2/+3
| | | | | I didn't quite understand this comment after looking at the code again months later, so I reworded it for better clarity.
* vo_opengl: make operator precedence explicitwm42014-11-261-1/+2
| | | | More readable.
* vo_opengl: fix srgb with certain inputswm42014-11-261-1/+1
| | | | | | | | | Sampling from the source texture and scaling must always be done separately in this mode. Fix suggested by haasn. Still looks a bit wrong, though.
* vo_opengl: somethingwm42014-11-261-1/+1
| | | | | | Insert explanation here. Fixes #1023.
* ytdl: bump requrired youtube-dl version to 2014.11.26ChrisK22014-11-261-1/+1
|
* ytdl: Try to handle multi-arc videosChrisK22014-11-261-14/+37
| | | | | | | | this currently uses a sketchy but apparently working workaround, which will be removed once the neccessary changes in youtube-dl are implemented Fixes #1277
* ytdl: When using DASH, print actual durationChrisK22014-11-261-1/+5
| | | | | prints the actual duration as reported by youtube-dl to the terminal when available
* DOCS/crosscompile-mingw: updateTimothy Gu2014-11-261-8/+8
| | | | | | Add `.static` for MXE targets. Signed-off-by: wm4 <wm4@nowhere>
* manpage: lua: fix typo paramater -> parameterAlessandro Ghedini2014-11-261-1/+1
|
* demux_lavf: set PTS of first packet for formats with no timestampswm42014-11-251-0/+9
| | | | Makes time display work for some raw audio formats (*.shn).
* ao_alsa: fix channel map in pre-channel map API casewm42014-11-251-0/+1
| | | | Forgotten in commit 5d5f5b09.
* ao_alsa: always enable "plug" plugin for non-default devicewm42014-11-251-3/+2
| | | | | | | | | | | | | | This seems safer: otherwise, opening the AO could randomly fail if the audio formats happens to be not float. Unfortunately, this only works if the user does not select a device. Since ALSA devices are arbitrary strings, including plugins with complex parameters, it's not trivial or maybe even impossible to edit the string in a way the "plug" plugin is added. With --audio-device, it would be safe for users to select either "default" or one of the "plughw" devices. Everything else seems questionable.
* ao_alsa: select and set channel maps via channel map APIwm42014-11-251-28/+125
| | | | | | | | | | | | | | | | Use the ALSA channel map API for querying and selecting supported channel maps. Since we (probably?) want to be compatible with ALSA versions before the change, we still try to select the device name by channel map, and open that device. There's no way to negotiate a channel map before opening, so we're stuck with this approach. Fortunately, it seems these devices allow selecting and setting any other supported channel layout, so maybe this is not an issue at all. In particular, this avoids selecting the default (dmix) device, which can only do stereo. Most code is based on Martin Herkt <lachs0r@srsfckn.biz>'s alsa_ng branch, with heavy modifications.
* ao_alsa: minor fixeswm42014-11-251-4/+6
| | | | | | | | | | | | | Don't crash if no fallback channel layout could be found (caller can't handle NULL return from select_chmap()). Apparently this could never actually happen, though. Don't treat snd_pcm_hw_params_set_periods_near() failure as fatal error. Same deal as with snd_pcm_hw_params_set_buffer_time_near(). Actually free channel maps returned by snd_pcm_get_chmap(). Adjust some messages.
* client API: make sure youtube-dl is not used by defaultwm42014-11-251-0/+1
| | | | | | | Currently, --ytdl is off by default, but even if this is changed, never enable it by default for the client API. It would be inappropriate to start an intrusive external subprocess behind the host application's back.
* cocoa: don’t hand over view memory ownership to libmpv clientsStefano Pigozzi2014-11-251-1/+1
|
* audio: make mp_audio_config_to_str return a stack-allocated stringwm42014-11-254-23/+12
| | | | Simpler overall.
* ao_alsa: cleanupswm42014-11-251-97/+57
| | | | | | | | | No functional changes. ALSA_PCM_NEW_HW_PARAMS_API was a pre-ALSA 1.0.0 thing and does nothing with modern ALSA. It stopped being necessary about 10 years ago. 3 functions are moved to avoid forward references.
* player: add option not to use OSD/fontconfigwm42014-11-254-0/+16
| | | | | | | Makeshift-solution for working around certain fontconfig issues. With --use-text-osd=no, libass and fontconfig won't be initialized, and fontconfig won't block everything with scanning for fonts.
* audio: make mp_chmap_to_str() return a stack-allocated stringwm42014-11-246-27/+25
| | | | Simplifies memory management.
* ao_alsa: try to use the channel map reported by ALSAwm42014-11-242-1/+66
| | | | | | | | If ALSA reports a channel map, and it looks like it makes sense (i.e. could be converted to mpv channel map, and the channel count matches), then use that instead of the channel map we are assuming. This is based on code written by lachs0r (alsa_ng branch).
* travis: restrict build matrix furtherwm42014-11-241-0/+4
| | | | | | | | | | | | | | | | We don't actually want to test all possible combinations; we just want to make sure that each thing (e.g. linux/osx, ffmpeg/libav) is tested once. Exclude Linux + ffmpeg-stable, because ffmpeg-stable is already tested on OSX. Exclude clang on Linux, because OSX needs clang, but Coverity (running on Linux) needs gcc - so we use gcc only on Linux. I also wanted to reduce the matrix to a single configuration when running Coverity, but apparently this is not possible. (See travis-ci/travis-ci#1975.)
* travis: add gcc to the build matrixwm42014-11-241-0/+4
| | | | | | | | For the purpose of running Coverity correctly. Although I'm not sure how well this works. gcc won't work on OSX, and also I'm not sure if Coverity will act up if the build matrix has more than 1 configuration (will it submit multiple scans?).
* input: simplifywm42014-11-245-38/+25
|
* lua: remove redundant callwm42014-11-241-1/+0
|
* lua: always handle key repeat on the script sidewm42014-11-242-5/+8
| | | | | | Simpler, and leaves the decision to repeat or not fully to the script (instead of requiring the user to care about it when remapping a script binding).
* lua, ipc: remove leftoverswm42014-11-243-19/+0
| | | | | | MPV_EVENT_SCRIPT_INPUT_DISPATCH is now unused/deprecated. Also remove a debug-print from defaults.lua.
* command: don't queue framestepswm42014-11-232-1/+15
| | | | | If repeated framestep commands are sent, just unpause the player, instead of playing N frames for N repeated commands.
* player: don't crash when using sub_seek without subtitleswm42014-11-231-2/+0
| | | | | | Recent regression. It turns out the assertion was completely unneeded. Fixes #1285.
* input, lua: redo input handlingwm42014-11-2312-79/+211
| | | | | Much of it is the same, but now there's the possibility to distinguish key down/up events in the Lua API.
* client API: restrict client nameswm42014-11-232-20/+22
| | | | | | Use a fixed size array for the client name, which also limits the client name in size. Sanitize the client name string, and replace characters that are not in [A-Za-z0-9] with '_'.
* x11: fix crashwm42014-11-231-1/+1
| | | | Broken by previous commit. Oops.
* x11: fix crash with --wid=0 and vo_xv/vo_x11wm42014-11-231-2/+5
| | | | | | | But seriously, don't use --wid=0, don't use vo_xv, and _especially_ don't use vo_x11. Fixes #1284.
* input: set mouse area by default for all inputwm42014-11-232-2/+3
| | | | | | | | | | Otherwise, mouse button bindings added by mp.add_key_binding() would be ignored. It's possible that this "breaks" some older scripts using undocumented Lua script functions, but it should be safe otherwise. Fixes #1283.
* subprocess: minor cosmetic cleanupwm42014-11-223-5/+9
| | | | | Don't recursively include the whole stream.h header; only include what's minimally needed, and handle the rest with forward declarations.
* README: cleanup contact sectionwm42014-11-221-7/+7
| | | | | I spotted to the grammatically incorrect "it's", and ended up redoing parts of the section.
* lua: subprocess: move to osdep/subprocess-{win,posix}.cJames Ross-Gowan2014-11-226-478/+553
| | | | | | The subprocess code was already split into fairly general functions, separate from the Lua code. It's getting pretty big though, especially the Windows-specific parts, so move it into its own files.
* manpage: update utils.subprocess() for WindowsJames Ross-Gowan2014-11-221-2/+3
|
* lua: subprocess: use macros for SetHandleInformationJames Ross-Gowan2014-11-221-1/+2
| | | | | Apparently both parameters refer to the same set of flags (the first is a mask for which flags to set.)
* lua: subprocess: fix handle inheritance race conditionJames Ross-Gowan2014-11-221-11/+87
| | | | | | | | | | | | | | | Normally, when creating a process with inherited handles on Windows, the process inherits all inheritable handles from the parent, including ones that were created on other threads. This can cause a race condition, where unintended handles are copied into the new process, preventing them from being closed correctly while the process is running. The only way to prevent this on Windows XP was to serialise the creation of all inheritable handles, which is clearly unacceptable for libmpv. Windows Vista solves this problem by allowing programs to specify exactly which handles are inherited, so do that on Vista and up. See http://blogs.msdn.com/b/oldnewthing/archive/2011/12/16/10248328.aspx
* lua: subprocess: fix Ctrl+C handling on WindowsJames Ross-Gowan2014-11-221-3/+11
| | | | | | | | | | | | The CREATE_NO_WINDOW flag is used to prevent the subprocess from creating an empty console window when mpv is not running in a console. When mpv is running in a console, it causes the subprocess to detach itself, and prevents it from seeing Ctrl+C events, so it hangs around in the background after mpv is killed. Fix this by only specifying CREATE_NO_WINDOW when mpv is not attached to a console. When it is attached to a console, subprocesses will automatically inherit the console and correctly receive Ctrl+C events.
* lua: subprocess: cancel pending I/O before returnJames Ross-Gowan2014-11-221-2/+7
| | | | | | | I'm not sure if this is necessary, but it can't hurt, and it's what you're supposed to do before leaving the stack frame that contains the OVERLAPPED object and the buffer. If there is no pending I/O, CancelIo will do nothing and GetOverlappedResult will silently fail.
* TOOLS/idet.sh: Adjust for changes in FFmpeg.Rudolf Polzer2014-11-221-5/+1
| | | | Compatibility to older idet is preserved.
* parse_configfile: check quote termination properlywm42014-11-211-0/+7
| | | | | | This is some terrible code; I blame MPlayer legacy. Found by Coverity.
* m_property: fix a typowm42014-11-211-1/+1
| | | | | | The wrong value was checked for an error. Oops. Found by Coverity.
* ao_pcm: simplifywm42014-11-211-17/+13
| | | | Also shuts up Coverity.
* ao_oss: check whether setting samplerate succeedswm42014-11-211-2/+4
| | | | | | | Independent from whether the samplerate was accepted or adjusted, errors returned by the ioctl are fatal errors. Found by Coverity.
* ao_lavc: fix setting up AVFrame pointerswm42014-11-211-3/+4
| | | | | | The caller set up the "start" pointer array using the number of planes, the encode() function used the number of channels. This copied uninitialized values for packed formats, which makes Coverity warn.
* af_scaletempo: use float division for ratewm42014-11-211-1/+1
| | | | | | | | From what I understand the division is to align the dimension of the value from seconds to milliseconds. Hard to tell whether the "rounding" was intentional or not; I'm tipping on "not". Found by Coverity.
* Silence some Coverity warningswm42014-11-214-2/+4
| | | | None of this really matters.
* Remove some unneeded NULL checkswm42014-11-214-25/+22
| | | | Found by Coverity; also see commit 85fb2af3.
* README: add Coverity statuswm42014-11-211-0/+2
| | | | Because it looks nice.
* draw_bmp: make code more obvious, remove assertionwm42014-11-211-3/+3
| | | | | | | Silences a Coverity warning. Also, drop the assert(); although it should be pretty much guaranteed that things happen this way, it's still a bit fuzzy.
* stream: fix endian swappingwm42014-11-211-2/+2
| | | | | | | | | | In addition to the messed-up expression, the endianness was also inverted. The code reads big endian by default. It "worked" by coincidence, but for little endian, codepoints outside of latin1 were broken. The broken expression was found by Coverity.
* bstr: don't call memcpy(..., NULL, 0)wm42014-11-211-0/+2
| | | | | | This is clearly not allowed, although it's not a problem on most libcs. Found by Coverity.
* Remove some superfluous NULL checkswm42014-11-214-7/+3
| | | | | | | | In all of these situations, NULL is logically not allowed, making the checks redundant. Coverity complained about accessing the pointers before checking them for NULL later.
* ipc: fix confusion of write() return value and errnowm42014-11-211-3/+3
| | | | Found by Coverity.
* demux_mkv: fix scary sign extension issueswm42014-11-211-8/+8
| | | | | | | Expressions involving uint16_t are promoted to int, which then can overflow if the uint16_t values are large enough. Found by Coverity.
* demux_mkv: fix possible real-audio out of bounds accesses</