summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Replace tallocwm42013-10-139-1928/+1098
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are multiple reasons to do this. One big reason is the license: talloc is LGPLv3+, which forces mpv to be licensed as GPLv3+. Another one is that our talloc copy contains modifications, which makes it essentially incompatible with upstream talloc (in particular, our version aborts on out of memory conditions - well, it wasn't my idea). Updating from upstream is also a bit involved - the talloc source is not really organized in a way to allow copying it into projects (and this isn't an intended use-case). Finally, talloc is kind of big and bloated. The replacement halves the amount of code - mainly because we didn't use all talloc features. It's even more extreme if you compare upstream talloc (~4700 lines) and the new allocator without talloc compat (~900 lines). The replacement provides all features we need. It also doesn't clash with talloc. (The talloc compatibility wrapper uses macros to avoid introducing linker-level symbols which could clash with libtalloc.) It also tries to lower the overhead (only 4 words opposed to 10 words in talloc for leaf nodes in release mode). Debugging features like leak reporting can be enabled at compile time and add somewhat more overhead. Though I'm not sure whether the overhead reduction was actually successful: allocations with children need an "extra" header, which adds plenty of overhead, and it turns out that almost half of all allocations have children. Maybe the implementation could be simplified and the extra header removed - even then, overhead would be lower than talloc's. Currently, debugging features can be entirely deactivated by defining NDEBUG - I'm not sure if anything defines this directly yet, though. Unlike in talloc, the leak reporting stuff is thread-safe. (That's also why it's far less elegant, and requires extra list pointers.) Comes with a compatibility layer, so no changes to mpv source code are needed. The idea is that we will pretend to be using talloc for a while, so that we can revert to our old talloc implementation at any time for debugging purposes. Some inspiration was taken from Mesa's ralloc: http://cgit.freedesktop.org/mesa/mesa/tree/src/glsl/ralloc.h This is another talloc replacement, but lacks some features we need (getting size of an allocation, debugging features, being able to access children in the dtor). There's some information in ta/README what will happen next and how the transition is expected to progress.
* talloc: change talloc destructor signaturewm42013-10-138-30/+14
| | | | | | | | | | | | | Change talloc destructor so that they can never signal failure, and don't return a status code. This makes our talloc copy even more incompatible to upstream talloc, but on the other hand this is preparation for getting rid of talloc entirely. (The talloc replacement in the next commit won't allow the talloc_free equivalent to fail, and the destructor return value would be useless. But I don't want to change any mpv code either; the idea is that the talloc replacement commit can be reverted for some time in order to test whether the talloc replacement introduced a regression.)
* cocoa: make --ontop also cover dock+menubarStefano Pigozzi2013-10-121-1/+3
| | | | | This only shows any differences when mpv isn't frontmost and is in fullscreen. Cmd+Tab overlay is still at a higher level as to avoid complete usability fail.
* command: preferably show "add"/"cycle"/"set" command errors on OSDwm42013-10-121-10/+10
| | | | | | Before this, they were shown on terminal only. Now they use the OSD mechanism, which shows them on the video window or the terminal, depending on settings and what's available.
* command: don't allow changing volume if no audio initializedwm42013-10-123-0/+12
| | | | | | | | | | | | | | | | | | | | | | | Changing volume when audio is disabled was a feature request (github issue #215), and was introduced with commit 327a779. But trying to fix github issue #280 (volume is not correct in no-audio mode, and if audio is re-enabled, the volume set in no-audio mode isn't set), I concluded that it's not worth the trouble and the current implementation is questionable all around. (For example, you can't change the real volume in no-audio mode, even if the AO is open - this could happen with gapless audio.) It's hard to get right, and the current mixer code is already hilariously overcomplicated. (Virtually all of mixer.c is an amalgamation of various obscure corner cases.) So just remove this feature again. Note that "options/volume" and "options/mute" still can be used in idle mode to adjust the volume used next time, though these properties can't be used during playback and thus not in audio-only mode. Querying the volume still "works" in audio-only mode, though it can return bogus values.
* playlist: check for NULL on caller sitewm42013-10-122-2/+3
| | | | | Letting some playlist functions randomly accept NULL, while others do not isn't such a good idea.
* options: --loop=N means playback N times, not N+1 timesPhilip Sequeira2013-10-123-8/+9
| | | | | | | | | | The argument or this change is that --loop should set how often the file is played, not the number of additional repeats. Based on pull request 277, with additions to the manpage and removal of "--loop=0". Signed-off-by: wm4 <wm4@nowhere>
* libquvi9: work around insane interaction between libquvi and libkdecorewm42013-10-121-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The primary effect of this commit is that it fixes playback resume if libquvi 0.9 and German locale are used, and libkdecore is on the system. (See github issue #279.) libquvi uses libproxy to determine system-wide proxy settings. libproxy in turn loads libkdecore (if present) to determine KDE proxy settings. libkdecore has a global constructor, which calls setlocale(LC_ALL, ""), switching the current locale from "C" to what the user's settings. This breaks some basic C string processing functions. Note that the locale won't be set on program start, but only when libproxy calls dlopen() on its config_kde module, which actually causes libkdecore to be loaded and initialized. In particular, with German locale, snprintf() would use "," instead of "." when formatting float values, which in combination with playback resume, would lead to parse errors the next time mpv was started, which is how this issue was found. I'd consider this a bug with libkdecore or at least libproxy. No library should ever even touch locale: it might break basic expectations on C string handling functions, might override program settings, and it's not thread-safe. But this is so nasty and severe, that a quick hack to fix it hurts less. See github issue #279 and KDE bug #325902.
* cocoa: refactor precise scrolling to a separate methodStefano Pigozzi2013-10-121-4/+7
|
* cocoa: fix mouse wheel scrollingMad Fish2013-10-121-1/+1
|
* mpvcore/playlist.c: Avoid NULL reference in playlist_add_base_path()Mohammad Alsaleh2013-10-111-1/+1
| | | | | | | | | | Before this patch, those will cause a crash: mpv -playlist /dev/null mpv -playlist <(bla) # if the result of bla is empty Signed-off-by: Mohammad Alsaleh <CE.Mohammad.AlSaleh@gmail.com> Signed-off-by: Stefano Pigozzi <stefano.pigozzi@gmail.com>
* cocoa_common: check if the screen has a menubar in a more generic wayStefano Pigozzi2013-10-091-1/+3
| | | | Fixes #274
* mp_ring: fix mp_ring_read_cb() when read wraps aroundWilliam Light2013-10-081-2/+10
| | | | | | previously, mp_ring_read_cb() would allow reading past the end of the ringbuffer when buffered > available. mp_ring_read() had logic for splitting the read into two, which I duplicated into mp_ring_read_cb().
* demux_raw: set a default video sizewm42013-10-071-2/+2
|
* command: sub_seek: avoid getting stuckwm42013-10-072-2/+10
| | | | | | | | | First, don't try to seek if the result is 0 (i.e. nothing found, or subtitle event happens to be exactly on spot). Second, since we never can make sure that we actually seek to the exact subtitle PTS (seeking "snaps" to video PTS), offset the seek by 10ms. Since most subtitle events are longer than 10ms, this should work fine.
* osc: Okay, don't multiply the cache valueChrisK22013-10-071-5/+1
| | | | As expected, this is not liked.
* osc: Display cache fill statusChrisK22013-10-071-1/+21
| | | | | | The OSC will now display cache fill status between the timecodes, but only if it's below 48% to not clutter the interface with erratically changing values. By default, the displayed value is multiplied by 2 to not confuse users who are unfamillar with the inner workings of the caching system. This can be disabled using the iAmAProgrammer=true setting.
* osc: Add another scale option for forced windows.ChrisK22013-10-061-3/+6
| | | | If the OSC is rendered on a forced window (by --force-window), the scale can be configured with scaleForcedWindow.
* ad_mpeg123: support in-stream format changesThomas Orgis2013-10-061-61/+88
| | | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@36461 b3059339-0415-0410-9bf9-f77b7e298cf2 Fixes playback of http://mpg123.org/test/44and22.mp3 Cherry-picked from MPlayer SVN rev. #36461, a patch by Thomas Orgis, committed by by Reimar Döffinger.
* vo_x11, vo_xv: fix OSD redrawing with --force-windowwm42013-10-062-16/+19
| | | | The window wasn't cleared in this mode before doing the redrawing.
* mplayer: don't resume playlist if --no-resume-playback is usedwm42013-10-061-0/+2
|
* ao_sndio: add documentationChristian Neukirchen2013-10-051-0/+9
|
* command: add commands for displaying overlayswm42013-10-058-4/+227
| | | | | | Requested by github issue #255. Does not work where mmap is not available (i.e. Windows).
* command: add properties for retrieving OSD dimensionswm42013-10-054-0/+31
|
* mplayer: fix some issues with playlist_prev commandwm42013-10-051-1/+9
| | | | | | | | | | | | | | | | You couldn't jump to the first entry in the playlist, if that entry was marked as "too short". But this is usually fine, because it doesn't get into the way of the user. (This feature is meant to allow being able to jump backwards through the playlist even if a file immediately stops playback right after initialization, not to prevent playing these files at all.) Also, apply the skip logic when wrapping around the playlist when going backwards. This happens with --loop, because looping pretends the playlist is infinitely repeated forwards and backwards (as long as the playlist_prev/next commands are concerned). Also add some comments.
* mplayer: fix cleanup if VO initialization failswm42013-10-051-0/+1
| | | | | Just specifying a VO that doesn't exist would make it crash. Regression caused by commit 6a0408b.
* cocoa_common: add OS X 10.7 compatibility hacks includesStefano Pigozzi2013-10-052-0/+2
| | | | | I forgot these when I split the code. They will hopefully fix compilation on 10.7.
* mplayer: don't keep previous video frame with --force-windowwm42013-10-041-15/+14
| | | | | | | | | | When for example switching off the video stream, and --force-window is used, forcefully reconfigure the VO. This will reset the size, and will clear the window with black. Needed some effort, because you don't always want to clear the window on "discontinuity" points like going to a next file: this would introduce some flicker.
* gl_x11: fail gracefully if selected FBconfig has no X visualwm42013-10-031-0/+6
| | | | | | | | | | | glXGetVisualFromFBConfig() specifies specifies that it can return NULL if there is no associated X visual. Instead of crashing, let initialization fail. I'm not sure if this is actually supposed to work with a fallback visual (passing a NULL visual to vo_x11_config_vo_window would just do this), but let's play safe for now. Apparently this can happen when trying to use vo_opengl over a remote X display.
* ao_coreaudio: clear output buffer on buffer underrunStefano Pigozzi2013-10-031-0/+1
| | | | | | | | Output silence to the output buffer during underruns. This removes small occasional glitches that happen before the AUHAL is actually paused from the `audio_pause` call. Fixes #269
* audio/out: add sndio supportChristian Neukirchen2013-10-037-0/+496
| | | | Based on an earlier patch for mplayer by Alexandre Ratchov <alex@caoua.org>
* vo_opengl_old: mp_msg conversionwm42013-10-021-74/+65
| | | | This was the only thing in video/out/ left with major mp_msg() use.
* cosmetics: replace "CTRL" defines by enumswm42013-10-025-51/+61
| | | | Because why not.
* command: add sub_seek input commandwm42013-10-024-6/+27
| | | | | | | Essentially reuses the sub_step command, and is subject to the same restrictions. Seems to behave a bit strange sometimes, but generally works.
* input: remove strange offset from commands enumwm42013-10-021-1/+1
| | | | A leftover from 10 years of refactoring.
* command: don't let "avsync" property print NOPTS valuewm42013-10-021-0/+2
| | | | | | Can happen when seeking in audio files with attached picture. MP_NOPTS_VALUE doesn't really make sense outside of mpv internals, so don't return it.
* vo: mark frame lost after seek resetwm42013-10-021-0/+1
| | | | | | | Reverts a small change made in commit ed9295c. This is needed, because otherwise mplayer.c/update_video_attached_pic() thinks it never has to update the picture after initialization. (Maybe there would be more elegant ways to handle this, but not without adding extra state.)
* mplayer: osd bar depends on VO, not video decodingwm42013-10-021-1/+1
| | | | The OSD bar wasn't displayed, and instead a fallback message was shown.
* mplayer: make VO interaction work in --idle modewm42013-10-021-19/+34
| | | | | | | Didn't handle VO events, didn't handle OSD message management. There is probably still some strangeness left. --idle mode was never made for direct interaction.
* mplayer: change default window size for --force-windowwm42013-10-021-1/+1
| | | | Closer to the ubiquitous 16:9 screen aspect ratio. Requested by ChrisK3.
* mpv.desktop: add --force-windowwm42013-10-021-1/+1
| | | | Seems appropriate.
* command: subtitle support depends on VO, not video decodingwm42013-10-022-13/+9
| | | | | | | | | We can render subtitles if a VO is open. Whether we're decoding video (i.e. if mpctx->sh_video is set) doesn't really matter. Subtitle display with --force-window still doesn't quite work yet, because there's nothing to actually force redrawing of subtitles in this mode.
* core: add --force-windowwm42013-10-028-17/+103
| | | | | | | | | | | | | | | | | This commit adds the --force-window option, which will cause mpv always to create a window when started. This can be useful when pretending that mpv is a GUI application (which it isn't, but users pretend anyway), and playing audio files would run mpv in the background without giving a window to control it. This doesn't actually create the window immediately: it only does so only after initializing playback and when it is clear that there won't be any actual video. This could be a problem when starting slow or completely stuck network streams (mpv would remain frozen in the background), or if video initialization somehow is stuck forever in an in-between state (like when the decoder doesn't output a video frame, but doesn't return an error either). Well, we can pretend only so much that mpv is a GUI application.
* core: don't require "refresh" seek for --keep-openwm42013-10-021-7/+1
| | | | | | | | | | | | | | | | | | | | | Seeking normally resets the VO and throws away the currently displayed frame, so if you seek outside the video with --keep-open enabled, the window would normally be "stuck" and not redraw properly, because there is no source video frame that could be redrawn. To deal with this, a precise seek to the position of the last displayed video frame was issued. This usually worked, but it can fail for formats where seeking is broken or not possible (consider reading from a pipe). Fix this by changing the semantics for vo_seek_reset(): now the video frame is remembered even after seeking. Note that this changes behavior a little when trying to seek outside of a file with --keep-open enabled. Since no actual seek is done anymore, the video will remain "frozen" on the previous position, and you can't unpause or framestep to see the video between current position and actual end of the video. If users complain, I might revert this commit.
* vo_vdpau: don't blank screen on VOCTRL_RESETwm42013-10-021-16/+35
| | | | | | | | | | | vo_vdpau is the only VO which implements VOCTRL_RESET. Redrawing the last output frame is hard, because the output could consist of several source video frames with certain types of post-processing (deinterlacing). Implement redrawing as special case by keeping the previous video frames aside until at least one new frame is decoded. This improves the previous commit, but is separate, because it's rather complicated.
* video/out: always support redrawing VO window at any pointwm42013-10-028-15/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | Before, a VO could easily refuse to respond to VOCTRL_REDRAW_FRAME, which means the VO wouldn't redraw OSD and window contents, and the player would appear frozen to the user. This was a bit stupid, and makes dealing with some corner cases much harder (think of --keep-open, which was hard to implement, because the VO gets into this state if there are no new video frames after a seek reset). Change this, and require VOs to always react to VOCTRL_REDRAW_FRAME. There are two aspects of this: First, behavior after a (successful) vo_reconfig() call, but before any video frame has been displayed. Second, behavior after a vo_seek_reset(). For the first issue, we define that sending VOCTRL_REDRAW_FRAME after vo_reconfig() should clear the window with black. This requires minor changes to some VOs. In particular vaapi makes this horribly complicated, because OSD rendering is bound to a video surface. We create a black dummy surface for this purpose. The second issue is much simpler and works already with most VOs: they simply redraw whatever has been uploaded previously. The exception is vdpau, which has a complicated mechanism to track and filter video frames. The state associated with this mechanism is completely cleared with vo_seek_reset(), so implementing this to work as expected is not trivial. For now, we just clear the window with black.
* ao_coreaudio: fetch device name only for verbose log levelStefano Pigozzi2013-10-011-6/+8
| | | | | The previous code fetched the device name regardless of log level and then only printed it if log level was verbose.
* ao_jack: don’t force exact client nameMartin Herkt2013-09-301-1/+1
| | | | | | | | Trying to connect multiple mpv clients to JACK with the JackUseExactName option would fail unless the user manually specifies a unique client name. This changes the behavior to automatically generate a unique name if the requested one is already in use.
* x11: remove colormap code, always request TrueColor visualswm42013-09-303-164/+17
| | | | | | | | | | | | | | | | | | | | vo_x11 had a clever trick to implement a video equalizer: it requested a DirectColor visual. This is a X11 mechanism which allows you to specify a lookup table for each color channel. Effectively, this is a safe override for the graphic card's gamma ramp. If X thinks the window deserves priority over other windows in the system, X would temporarily switch the gamma ramp so that DirectColor visuals can be displayed as the application intends. (I'm not sure what the exact policy is, but in practice, this meant the equalizer worked when the mouse button was inside the window.) But all in all, this is just lots of useless code for a feature that is rarely ever useful. Remove it and use the libswscale equalizer instead. (This comes without a cost, since vo_x11 already uses libswscale.) One worry was that using DirectColor could have made it work better in 8-bit paletted mode. But this is not the case: there's no difference, and in both cases, the video looks equally bad.
* vf_scale: factor out libswscale equalizer controlwm42013-09-303-23/+34
| | | | Will be used by vo_x11.
* Remove completely outdated AUTHORS filewm42013-09-302-1117/+2
| | | | | | | | | | | | | | | | | | | | | | | | Considering that we use version control, maintaining an AUTHORS file doesn't make much sense, and indeed it was barely touched since the time mplayer2 forked from MPlayer. None of the contributors to mplayer2 or mpv are listed in this file (even uau's work is not appropriately reflected, despite having an entry in this file). I'm removing this file because it's obviously pointless to keep around, and moreover it's misleading. In theory removing this file might be questionable: the git log reaches back into CVS and SVN times, which don't have separate committer and author fields for each comment. The commit messages could be incomplete and not mention the original author, while the AUTHORS file somehow could. I doubt this is a real concern, since you can always reconstruct the original AUTHORS file from git. Another concern is that this could be interpreted as disrespectful to the people mentioned in this file; but it isn't meant to be disrespectful. Also point out a slight irregularity in the Copyright file.
* mplayer: fix looping of very short fileswm42013-09-293-7/+19
| | | | | | | | | | | | | | | Commit 884c179 attempted to make it possible to skip backwards through the playlist, even for files which fail to intitialize, or play for a very short time. This was also used to prevent mpv from looping forever and doing nothing if --loop=inf is used, and no file in the playlist is playable. This broke looping of very short files, because mpv was assuming that this case happened. But there are legitimate use cases. Fix this by making the looping case special. Instead of checking whether playback was "very short", check whether something could be decoded and displayed/played. If yes, allow looping.
* vaapi: remove non-VLD entrypointswm42013-09-291-6/+2
| | | | | These probably don't work. libavcodec doesn't seem to support them, and neither did the original mplayer-vaapi patch.
* vaapi: fix non-sense conditionwm42013-09-291-1/+1
| | | | Attempting signed comparison on unsigned value.
* vaapi: fix inverted conditionwm42013-09-291-2/+2
| | | | | | How embarrassing. This could make --hwdec=vaapi-copy as well as screenshots with vo_vaapi randomly fail. Regression since commit b8382aa.
* cocoa_common: call gl_clear indirectlyStefano Pigozzi2013-09-283-2/+23
| | | | | | | glClear needs GL headers and we don't want those in `cocoa_common`. Create a callback in `gl_cocoa` and register it `cocoa_common`. Fixes #264
* cocoa_common: