summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* input: handle multi-combinations as key sequenceswm42014-04-182-64/+60
| | | | | | | | | | | | | | | | | The input code always supported combinations of multiple keys (even in MPlayer, although there the code was active really only for mouse buttons). This was arcance and also made the code more complicated. I only know of a single person who ever made use of this feature. Remove this feature, and repurpose some of the support code (e.g. parsing, display of key combinations, etc.) to handle such multi- combinations as sequences, instead of keys to be pressed at the same time. This is much simpler and implements the feature requested in github issue #718. This commit will probably cause a bunch of regressions, since the input handling code has some weird corner cases. I couldn't find any problems when testing, though.
* audio: preallocate audio buffers on resizewm42014-04-181-2/+7
| | | | | | This avoids too many realloc() calls if the caller is appending to an audo buffer. This case is actually quite noticeable when using something that buffers a large amount of audio.
* manpage: document loop-file propertywm42014-04-181-0/+3
| | | | Was forgotten in commit 1b398e99.
* player: fix audio EOF check on --no-audiowm42014-04-181-1/+1
| | | | | This considered audio to never reach EOF when audio was disabled, instead of always being EOF.
* player: add a --loop-file optionwm42014-04-175-0/+20
| | | | Unlike --loop, loops a file instead of the playlist.
* player: unrangle one aspect of audio EOF handlingwm42014-04-174-14/+15
| | | | | | | | | | | | | | | | | | For some reason, the buffered_audio variable was used to "cache" the ao_get_delay() result. But I can't really see any reason why this should be done, and it just seems to complicate everything. One reason might be that the value should be checked only if the AO buffers have been recently filled (as otherwise the delay could go low and trigger an accidental EOF condition), but this didn't work anyway, since buffered_audio is set from ao_get_delay() anyway at a later point if it was unset. And in both cases, the value is used _after_ filling the audio buffers anyway. Simplify it. Also, move the audio EOF condition to a separate function. (Note that ao_eof_reached() probably could/should whether the last ao_play() call had AOPLAY_FINAL_CHUNK set to avoid accidental EOF on underflows, but for now let's keep the code equivalent.)
* w32_common: use ToUnicode to translate key inputJames Ross-Gowan2014-04-172-50/+184
| | | | | | | | | | | | | | | | This replaces translate_key_input with a solution that gives mpv more control over how keyboard input is converted to unicode. As a result: - Key up/down events are generated the same way for all keys. - Dead keys generate their base character instead of being combined with the following character. - Many Ctrl and Ctrl+Alt key combinations that were previously broken are fixed, since it's possible to discover the base keys. - AltGr doesn't produce special characters when mp_input_use_alt_gr is false. This also fixes some logic to do with detecting AltGr and adds proper UTF-16 decoding.
* audio: add hack against broken pulseaudio EOF conditionwm42014-04-171-1/+16
| | | | | | | | | | | | This was reported with PulseAudio 2.1. Apparently it still has problems with reporting the correct delay. Since ao_pulse.c still has our custom get_delay implementation, there's a possibility that this is our fault, but this seems unlikely, because it's full of workarounds for issues like this. It's also possible that this problem doesn't exist on PulseAudio 5.0 anymore (I didn't explicitly retest it). The check is general and works for all push based AOs. For pull based AOs, this can't happen as pull.c implements all the logic correctly.
* audio: explicitly document audio EOF conditionwm42014-04-172-1/+6
| | | | | | This should probably be an AO function, but since the playloop still has some strange stuff (using the buffered_audio variable instead of calling ao_get_delay() directly), just leave it and make it more explicit.
* ao_null: add simulated device latency, simulate EOF problemswm42014-04-172-3/+26
| | | | | This EOF problems happen at least with PulseAudio, but since it's hard to reproduce, let ao_null optionally simulate it.
* vo_opengl: make spline36 default with --vo=opengl-hqwm42014-04-172-3/+5
|
* player: add a --dump-stats optionwm42014-04-1711-9/+181
| | | | | | | | | | | | | | | | | | | | | | | This collects statistics and other things. The option dumps raw data into a file. A script to visualize this data is included too. Litter some of the player code with calls that generate these statistics. In general, this will be helpful to debug timing dependent issues, such as A/V sync problems. Normally, one could argue that this is the task of a real profiler, but then we'd have a hard time to include extra information like audio/video PTS differences. We could also just hardcode all statistics collection and processing in the player code, but then we'd end up with something like mplayer's status line, which was cluttered and required a centralized approach (i.e. getting the data to the status line; so it was all in mplayer.c). Some players can visualize such statistics on OSD, but that sounds even more complicated. So the approach added with this commit sounds sensible. The stats-conv.py script is rather primitive at the moment and its output is semi-ugly. It uses matplotlib, so it could probably be extended to do a lot, so it's not a dead-end.
* msg: correct ringbuffer log level comparisonFRAU KOUJIRO2014-04-171-1/+1
|
* stream_dvdnav: print more debugging infowm42014-04-171-1/+6
|
* stream_dvd: fix seeking regressionwm42014-04-171-8/+48
| | | | | | | | | | | | This was accidentally completely destroyed with commit 24f1878e. I didn't notice it when testing, because forward seeking still worked mostly. The issue was that dvd_seek_to_time() actually called stream_seek(), which was supposed to call the byte-level seek function dvd_seek(). So we have to restore this function, and replace all generic stream calls with stream_dvd.c internal ones. This also affects stream->pos (now a random number as far as stream_dvd.c is concerned) and stream_skip().
* ao: remove redundant get_delay checkwm42014-04-171-4/+0
| | | | It did nothing; the real check is in push.c.
* wayland: unset input regions for osdAlexander Preisinger2014-04-161-0/+4
| | | | | Set a zero sized input region for the osd surfaces in order to avoid getting input for the subsurfaces which might dissapear any time.
* wayland/shm: Use subsurfaces for OSDAlexander Preisinger2014-04-164-29/+133
|
* af_lavcac3enc: detach on any passthrough format, not just ac3wm42014-04-161-1/+1
|
* input: deal with playback thread wakeup on windowswm42014-04-151-3/+14
| | | | | | | | | | | | | The recent change of waking up the playback thread using a wakeup pipe doesn't work on windows, because windows is horrible. So use a condition variable instead to wake up the thread. To make things worse, jackaudio is also horrible and "disallows" the use of mutexes, so all we can do is implementing a half-solution that is not race condition free. It would probably better to give up on this lock-free crap in the pull- API audio path. Mostly untested.
* player: remove audio waitingwm42014-04-151-16/+0
| | | | | | | | The audio subsystem now wakes up the playback thread explicitly, and we don't need this anymore. It still could cause dropouts and such if there are bugs in the recently introduced audio changes, so this is a thing to watch out for.
* audio: wake up the core when audio buffer is running low (2)wm42014-04-153-2/+17
| | | | | | | | | | | | | | Same change as in e2184fcb, but this time for pull based AOs. This is slightly controversial, because it will make a fast syscall from e.g. ao_jack. And according to JackAudio developers, syscalls are evil and will destroy realtime operation. But I don't think this is an issue at all. Still avoid locking a mutex. I'm not sure what jackaudio does in the worst case - but if they set the jackaudio thread (and only this thread) to realtime, we might run into deadlock situations due to priority inversion and such. I'm not quite sure whether this can happen, but I'll readily follow the cargo cult if it makes hack happy.
* ao_pulse: use ao_need_data()wm42014-04-151-2/+2
| | | | | | | | | I'm not quite sure why ao_pulse needs this. It was broken when a thread to fill audio buffers was added to AO - the pulseaudio callback was waking up the playback thread, not the audio thread. But nobody noticed, so it can't be very important. In any case, this change makes it wake up the audio thread instead (which in turn wakes up the playback thread if needed).
* audio: wake up the core when audio buffer is running lowwm42014-04-152-15/+61
| | | | | | | | | | | | | | | | | And also add a function ao_need_data(), which AO drivers can call if their audio buffer runs low. This change intends to make it easier for the playback thread: instead of making the playback thread calculate a timeout at which the audio buffer should be refilled, make the push.c audio thread wakeup the core instead. ao_need_data() is going to be used by ao_pulse, and we need to workaround a stupid situation with pulseaudio causing a deadlock because its callback still holds the internal pulseaudio lock. For AOs that don't call ao_need_data(), the deadline is calculated by the buffer fill status and latency, as before.
* video: remove use of deprecated AVFrame fields on Libavwm42014-04-151-4/+0
| | | | | | qscale export has been completely removed from Libav 10, and FFmpeg has an alternative API, so this code does nothing and only causes deprecation warnings on Libav.
* README: mention minimum FFmpeg/Libav versionswm42014-04-151-0/+1
|
* client API: remove mpv_event_pause_reasonwm42014-04-148-98/+28
| | | | | | | | | And slightly adjust the semantics of MPV_EVENT_PAUSE/MPV_EVENT_UNPAUSE. The real pause state can now be queried with the "core-idle" property, the user pause state with the "pause" property, whether the player is paused due to cache with "paused-for-cache", and the keep open event can be guessed with the "eof-reached" property.
* command: add property to indicate when pausing due to --keep-openwm42014-04-145-2/+23
| | | | | | | This property is set to "yes" if playback was paused due to --keep-open. The change notification might not always be perfect; maybe that should be improved.
* command: add a property to indicate core pause statewm42014-04-142-2/+16
| | | | | | | | | Currently this is (probably) equivalent to "paused-for-cache", but the latter is a bit special, while this new property is a bit more general. One case where they might actually be different is dvdnav menus, but I haven't checked. Also add property change notifications for these two properties.
* vf_vapoursynth: handle destruction more gracefullywm42014-04-141-7/+8
| | | | | | | | | | | | | | We were relying on vsscript_freeScript() to take care of proper termination. But it doesn't do that: it doesn't wait for the filters to finish and exit at all. Instead, it just destroys all objects, which causes the worker threads to crash sometimes. Also, we're supposed to wait for the frame callback to finish before freeing the associated node. Handle this by explicitly waiting as far as we can. Probably fixes crashes on seeking, although VapourSynth itself might also need some work to make this case completely stable.
* options: don't allow --no-foo=yeswm42014-04-141-2/+2
| | | | | | | | | It's a bit strange to allow this, so get rid of it. This probably breaks a bunch of user config files. The client API still allows setting them with MPV_FORMAT_FLAG with a value of 1 (i.e. true), but I guess this is tolerable.
* video: change image format names, prefer mostly FFmpeg nameswm42014-04-143-91/+64
| | | | | | | | | | | | | | | The most user visible change is that "420p" is now displayed as "yuv420p". This is what FFmpeg uses (almost), and is also less confusing since "420p" is often confused with "420 pixels vertical resolution". In general, we return the FFmpeg pixel format name. We still use our own old mechanism to keep a list of exceptions to provide compatibility for a while. Also, never return NULL for image format names. If the format is unset (0/IMGFMT_NONE), return "none". If the format has no name (probably never happens, FFmpeg seems to guarantee that a name is set), return "unknown".
* New option --no-ometadata to opt out of including metadata when encoding.Rudolf Polzer2014-04-144-1/+11
| | | | | | | This re-allows the previous behaviour of being able to reencode with metadata removed, which is useful when encoding "inconsistently" tagged data for a device/player that shows file names when tags are not present.
* vf_vapoursynth: wipe vapoursynth state completely on reloadingwm42014-04-142-44/+56
| | | | | | | | Before this commit, the filter attempted to keep the vsscript state (p->se) even when the script was reloaded. Change it to destroy the script state too on reloading. Now no workaround for LoadPlugin is necessary, and this also fixes a weird theoretical race condition when destroying and recreating the mpv source filter.
* command: vf-metadata: minor fixup of return statusKevin Mitchell2014-04-141-1/+1
| | | | Signed-off-by: wm4 <wm4@nowhere>
* Remove radio://wm42014-04-1310-1192/+3
| | | | | It was disabled by default, works only for analogue radio, and I bet nobody uses it.
* Kill all tabswm42014-04-1365-6788/+6788
| | | | | | | | | | | I hate tabs. This replaces all tabs in all source files with spaces. The only exception is old-makefile. The replacement was made by running the GNU coreutils "expand" command on every file. Since the replacement was automatic, it's possible that some formatting was destroyed (but perhaps only if it was assuming that the end of a tab does not correspond to aligning the end to multiples of 8 spaces).
* af_volume: fix clang -Wsometimes-uninitializedKevin Mitchell2014-04-131-1/+1
|
* af_lavfi: fix graph parse deprecation warningKevin Mitchell2014-04-131-1/+1
|
* TOOLS: vf-metadata: lua cropdetect example scriptKevin Mitchell2014-04-131-0/+11
| | | | Signed-off-by: wm4 <wm4@nowhere>
* command: add vf-metadata propertyKevin Mitchell2014-04-132-2/+49
| | | | | | | This is a read-only property that uses VFCTRL_GET_METADATA to retrieve mp_tags metadata from a filter specified by label Signed-off-by: wm4 <wm4@nowhere>
* vf_lavfi: copy AVFrame metadata into vf_lavfi privKevin Mitchell2014-04-134-0/+39
| | | | | | | | store it as mp_tas and add VFCTRL_GET_METADATA to access it from elsewhere Signed-off-by: wm4 <wm4@nowhere> old-configure test by wm4.
* vf_lavfi: fix ffmpeg deprecation warning for avfilter_graph_parseKevin Mitchell2014-04-131-1/+1
| | | | use avfilter_graph_parse_ptr for ffmpeg
* vf: auto-label video filters if no label is specifiedKevin Mitchell2014-04-131-1/+12
| | | | Signed-off-by: wm4 <wm4@nowhere>
* vf: add vf_control_by_label to send vfctrl to specific filterKevin Mitchell2014-04-132-0/+12
|
* talloc README: more human readible api referenceKevin Mitchell2014-04-131-1/+1
|
* mp_tags: move generic mp_tags stuff into its own .c/.h files in common/Kevin Mitchell2014-04-137-65/+99
| | | | | | rename add_metadata to the more genera/descriptive mp_tags_copy_items_from_av_dictionary Signed-off-by: wm4 <wm4@nowhere>
* player: remove ASX, SMIL and NSC playlist parserswm42014-04-1312-1186/+44
| | | | | | | | | | | | | | | | | | | These playlist parsers are all what's left from the old mplayer playlist parsing code. All of it is old code that does little error checking; the type of C string parsing code that gives you nightmare. Some playlist parsers have been rewritten and are located in demux_playlist.c. The removed formats were not reimplemented. ASX and SMIL use XML, and since we don't want to depend on a full blown XML parser, this is not so easy. Possibly these formats could be supported by writing a very primitive XML-like lexer, which would lead to success with most real world files, but I haven't attempted that. As for NSC, I couldn't find any URL that worked with MPlayer, and in general this formats seems to be more than dead. Move playlist_parse_file() to playlist.c. It's pretty small now, and basically just opens a stream and a demuxer. No use keeping playlist_parser.c just for this.
* wayland: don't schedule resize if going fullscreenRicardo Vieira2014-04-131-1/+0
| | | | mpv was resizing to the same size before it went to fullscreen, we don't need to schedule a resize because the compositor will send a configure event with the new dimensions and thats when we should do it.
* player: hack to fix --msgmodule --term-osd-barwm42014-04-131-1/+1
| | | | | | | | | Basically a cheap hack to fix that the --msgmodule prefix will cause an unwanted linebreak by making the line too long. Suggested by Hamuko in github issue #710. Fixes #710.
* command: add paused-for-cache, total-avsync-change, drop-frame-count propertiesDavid Weber2014-04-132-0/+44
| | | | | | | | | This is needed if you want to reimplement the status line in lua I could only test drop-frame-count because I didn't find an easy way to trigger paused-for-cache and total-avsync-change Signed-off-by: wm4 <wm4@nowhere>
* vf_vapoursynth: print an error if VapourSynth returns an unknown formatwm42014-04-131-0/+1
| | | | | Apparently there is no real format negotiation, so this can actually happen.
* vf_vapoursynth: error out early if the file sub-option is not setwm42014-04-131-0/+4
| | | | Instead of crashing by possibly passing a NULL pointer to VapourSynth.
* manpage: vf_vapoursynth: document what happens on seekingwm42014-04-131-0/+8
| | | | Unfortunately, reloading on seeking causes real problems.
* manpage: lua: separate "advanced" functions into a separate sectionwm42014-04-121-4/+10
| | | | This will be less confusing.
* lua: make it easier to integrate with foreign event loopswm42014-04-122-6/+46
| | | | We provide some "official" utility functions for this.
* lua: wrap mpv_get_wakeup_pipe()wm42014-04-122-0/+12
| | | | Pretty much experimental for issue #661.
* client API: add mpv_get_wakeup_pipe convenience functionwm42014-04-124-2/+68
| | | | Should make integreating with some event loops easier. Untested.
* video: add VapourSynth filter bridgewm42014-04-127-1/+554
| | | | | | | | | | | | Mainly meant to apply simple VapourSynth filters to video at runtime. This has various restrictions, which are listed in the manpage. Additionally, this actually copies video frames when converting frame references from mpv to VapourSynth, and a second time when going from VapourSynth to mpv. This is inefficient and could probably be easily improved. But for now, this is simpler, and in fact I'm not sure if we even can references VapourSynth frames after the core has been destroyed.
* options: don't sort sub-option help outputwm42014-04-121-1/+2
| | | | | | Commit 2c2c1203 sorted the output of --list-options, but the same code ias also used for listing sub-options, such as --vo=scale:help. For sub- options, the order actually matters.
* terminal: pretty print modules for --msgmoduleEvan Purkhiser2014-04-121-2/+26
|
* manpage: fix --vf=scale optionsJames Ross-Gowan2014-04-111-3/+3
|
* options: sort --list-optionswm42014-04-111-1/+13
| | | | | | | | | | | | Until now, --list-options printed options in random order. There literally wasn't any logic in its order, they just appeared as they were declared. So just sort them. Note that we can't sort them in advance, because for certain things internal to m_config, the order actually matters. Also we're using strcasecmp(), which is bad (locale dependent), but this is output intended for human consumption, so it's not a problem.
* command: remove extended information from --list-propertieswm42014-04-111-19/+4
| | | | | | This used to display the property type, but it was not always correct or even available. The way the property mechanism works, we can know this only at runtime.
* client API: include the reason in MPV_EVENT_END_FILEwm42014-04-113-1/+29
| | | | | | | | | Otherwise, the client API user could not know why playback was stopped. Regarding the fact that 0 is used both for normal EOF and EOF on error: this is because mplayer traditionally did not distinguish these, and in general it's hard to tell the real reason. (There are various weird corner cases which make it hard.)
*