summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | m_config: try to print min/max values as integers in --list-optionswm42013-07-281-2/+2
| | | | | | | | | | This switched to exponential representation too soon, and large integer values looked bad in the --list-options output.
* | m_config: hide no-* opts in --list-options, simplify positional suboptswm42013-07-282-19/+23
| | | | | | | | | | | | | | All these --no-... options in --list-options made the output rather unreadable, so hide them. Make the code for finding positional parameters (which are supposed to skip these no-* options) slightly simpler too.
* | options: print default values in --list-optionswm42013-07-281-0/+24
| | | | | | | | | | | | | | | | | | | | Do this by recreating the m_config from scratch, which then must contain the default values. This doesn't quite work with legacy options using global variables: the default values get lost, so using --list-options will print the value as set by the config file. This also introduces a memory leak for string options backed by global variables. All of these issues will be eventually fixed by moving all options to structs.
* | m_config: refactor some thingswm42013-07-288-152/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change how m_config is initialized. Make it more uniform; now all m_config structs are intialized in exactly the same way. Make sure there's only a single m_option[] array defining the options, and keep around the pointer to the optstruct default value, and the optstruct size as well. This will allow reconstructing the option default values in the following commit. In particular, stop pretending that the handling of some special options (like --profile, --v, and some others) is in any way elegant, and make them explicit hacks. This is really more readable and easier to understand than what was before, and simplifies the code.
* | core: make mpctx->opts a pointerwm42013-07-287-131/+132
| | | | | | | | | | | | | | | | Prevents some awkwardness in a later commit, and makes the code more uniform with other places where MPOpts is accessed. This is a pretty annoying commit (touches tons of lines all over the place), but it hurts only once.
* | command: mark special options as unavailablewm42013-07-281-0/+2
| | | | | | | | | | Special options (like -v, -playlist, etc.) don't have data associated with them, so reading them with the "options" property makes no sense.
* | mp_image: pass through colorspace info to libavfilterwm42013-07-281-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | This change affects vf_lavfi. Until recently, libavfilter was not colorspace aware at all. This changed with the addition of colorspace fields to AVFrame. libavfilter's vf_scale picks them up (as of recent ffmpeg git). Since this support is still kind of wonky and not part of the normal format negotiation, this won't set the correct output colorspace, though. Not adding a separate test for HAVE_AVFRAME_COLORSPACE. This is slightly unclean, but on the other hand adding an explicit test seems like a waste of effort.
* | vf: fix unintended overwriting of image infowm42013-07-282-4/+5
| | | | | | | | | | | | The symptom was that "-vf scale,format=rgba" broke the vsfilter colorspace hack in sd_ass. vf->reconfig is allowed to overwrite its input parameter for convenience (maybe that was a bad idea).
* | ao_coreaudio: prevent buffer underruns to output garbageStefano Pigozzi2013-07-281-1/+6
| | | | | | | | | | | | This was removed in d427b4fd. I now found a sample that causes underruns when moving to a chapter and apparently this is also a problem when taking screenshots.
* | ao_coreaudio: fix compilation on OS X 10.7Dmitry Kalinkin2013-07-281-1/+1
|/ | | | | | | | | | | | Reverts one of the changes from 18777ecf. `kAudioObjectPropertyScopeOutput` was introduced in the 10.8 SDK while `kAudioDevicePropertyScopeOutput` was moved to `AudioHardwareDeprecated.h`. Since the deprecation is silent for now (no warnings), just use the old constant. Either way, they both evaluate to 'outp', and in the 10.8 SDK the deprecated constant is defined in terms of the non-deprecated one. Fixes #155
* getch2: Load the "ce", "ks" and "ke" caps into a static bufferDiogo Franco (Kovensky)2013-07-261-3/+6
| | | | | | Fixes reports of printing of garbage (or anything else) other than clearing the status line to the end of line: the buffer returned by termcap_get could get moved, and if that happened then these 3 caps pointed to garbage.
* getch2: Deactivate getch2 on SIGINT; also handle SIGQUITDiogo Franco (Kovensky)2013-07-261-0/+4
|
* getch2: Only send ESC if it was typed twiceDiogo Franco (Kovensky)2013-07-261-3/+5
| | | | Avoids quitting mpv if any unknown escape is entered.
* getch2: Handle setupterm errorsDiogo Franco (Kovensky)2013-07-261-1/+18
| | | | | | setupterm abort()s if it can't initialize the terminal and the last parameter is NULL; handle setupterm errors and retry with "ansi" if the TERM env var was unset.
* getch2: fix compilationwm42013-07-261-1/+1
|
* options: simplify --correct-pts handlingwm42013-07-266-20/+9
| | | | | | Remove the (now unused) code for determining correct-pts mode based on the demuxer in use. Change its description in the manpage to reflect what this option does now.
* getch2: Support ESC keypresses againDiogo Franco (Kovensky)2013-07-251-1/+9
| | | | | | Due to the termcap matching and the hardcoded fallbacks, the ESC keypress has to be followed by another non-matching keypress (such as another ESC) for it to be accepted. We drop the second ESC in case it was typed twice.
* configure: fix terminfo checkwm42013-07-261-1/+1
| | | | | | On Linux, the check fails because NULL is not defined. Fix by using 0 instead, which is a perfectly valid null pointer constant, but doesn't require stddef.h.
* gl_video: make sure image parameters are correctly set on screenshotswm42013-07-261-7/+8
| | | | Makes sure the chroma_location doesn't get lost.
* command: allow printing time properties with millisecondswm42013-07-261-9/+35
| | | | | | | | | | | | | | Doing e.g. show_text "${time-pos/full}" will show the time formatted with a milliseconds part. This is actually special cased for a few properties which use CONF_TYPE_TIME, instead of making all properties using CONF_TYPE_TIME respect this. This is a technical limitation. I'm not entirely happy with this approach, so I'll leave it undocumented. It's relatively ok, but he fact that it's special-cased to some properties is not elegant. So for now, this is just a hack to make ChrisK2 happy (hi there).
* command: add pseudo-property that allows you to read global optionswm42013-07-262-0/+28
| | | | | | | | | | | | The "options" pseudo-property allows reading global like this: show_text ${options/name} Where "name" maps to the option "--name". This allows retrieving option values that are not properties. Write-access is not possible: this is reserved for normal properties. Note: it is possible that we'll change this again, and don't require the "options/" prefix to access options.
* m_property: fix non-sense codewm42013-07-261-1/+2
| | | | Undefined behavior.
* video: support setting libswscale chroma positionwm42013-07-256-1/+41
|
* w32_common: Don't use globals for TRACKMOUSEEVENTDiogo Franco (Kovensky)2013-07-252-11/+12
| | | | It seems working on getch2 gave me some brain damage.
* w32_common: Track when the mouse leaves the windowDiogo Franco (Kovensky)2013-07-251-0/+15
| | | | | | | | | Windows doesn't send WM_MOUSELEAVE by default unless you ask it to; request tracking for leave events when the mouse enters the window (or is moved). Tracking is automatically de-activated once the mouse leaves the window, so we have to re-request it every time the mouse re-enters the window.
* getch2: Doing it right this timeDiogo Franco (Kovensky)2013-07-251-1/+1
| | | | | getch2_pos should be set to 1, not 0, when backtracking. Avoids the possible infinite loop but correctly.
* Revert "getch2: Avoid possible infinite loop"Diogo Franco (Kovensky)2013-07-251-4/+4
| | | | This reverts commit ba95aed6f1067dc577d8813625233982157167d9.
* getch2: Avoid possible infinite loopDiogo Franco (Kovensky)2013-07-251-4/+4
| | | | | | If the first character is not a valid UTF-8 start code nor is in termcap, getch2 would enter an infinite loop. Always walk 1 byte in the UTF-8 case unless it's a valid start code.
* Merge branch 'getch2/refactor'Diogo Franco (Kovensky)2013-07-254-196/+371
|\ | | | | | | | | | | | | | | * getch2/refactor: configure: Fix bad variable assignment getch2, mplayer: Always call load_termcap getch2: Remove unused function, fix possible crash getch2: Refactor/rewrite
| * configure: Fix bad variable assignmentDiogo Franco (Kovensky)2013-07-251-1/+1
| | | | | | | | Bourne shell hates having spaces before or after the = sign.
| * getch2, mplayer: Always call load_termcapDiogo Franco (Kovensky)2013-07-252-2/+5
| | | | | | | | | | getch2 now deals with the cases where we don't have termcap. Add a dummy load_termcap to getch2-win so we don't get linking errors on mingw.
| * getch2: Remove unused function, fix possible crashDiogo Franco (Kovensky)2013-07-251-25/+19
| | | | | | | | | | | | | | | | | | If we still haven't read the full key from the input but it's regardless a unique match in the database, we could receive a NULL keycode from keys_search (it's not a full match after all) and proceed to use it. Don't disable the keycode matching code if we don't have termcap as we can still match against the hardcoded sequences.
| * getch2: Refactor/rewriteDiogo Franco (Kovensky)2013-07-252-192/+370
|/ | | | | | | | | | | | | | | | | | | | | | Still uses termcap, but uses terminfo for loading the termcap database if possible. Adds configure test to find terminfo; skips the termcap test if terminfo is found since terminfo provides termcap. Use termcap completely for special keys; if we can't get it from termcap and it isn't one of the known fallbacks, we ignore its specialness and treat as a sequence of UTF-8 codes. Further hardcoded fallbacks can be added by calling keys_push_once in load_termcap; there is no limit to the amount of keys pushed. Uses the "ke" and "ks" capabilities to start / exit application mode, which is necessary on vt100 emulators (including screen, xterm and all terminals that emulate either of those) to correctly receive arrow keys. It's now possible to compile getch2 even without termcap, though it won't be of much use since it'll be unable to detect special keys. Converted to 4 spaces per tab, prettified some statements.
* mp_msg: Support colors on cygwinDiogo Franco (Kovensky)2013-07-241-1/+1
| | | | | A cygwin mpv will usually run inside mintty, and even if it were to be run in a regular console window, the cygwin dll emulates ANSI escapes.
* demux_libass: actually set priv contextwm42013-07-241-0/+1
| | | | This was a memory leak: the ASS_Track was never deallocated.
* mp_image: create AVBuffers for all planes when converting to AVFramewm42013-07-241-1/+9
| | | | | | | | | | | | | | | | It appears the API requires you to cover all plane data with AVBuffers (that is, one AVBuffer per plane in the most general case), because certain code can make certain assumptions about this. (Insert rant about how this is barely useful and increases complexity and potential bugs.) I don't know any cases where the current code actually fails, but we want to follow the API, so do it anyway. Note that we don't really know whether or not planes are from a single memory allocation, so we have to assume the most general case and create an AVBuffer for each plane. We simply assume that the data is padded to the full stride in the last image line. All these extra dummy references are stupid, but the code might become much simpler once we only support libavcodec versions with refcounting and can use AVFrame directly.
* m_config: don't override profile option if not requiredwm42013-07-242-1/+4
| | | | | | | The --profile top-level option is handled specially in m_config.c. But this code also broke sub-options that happened to be named "profile" (e.g. when trying to use "-af-add=bs2b=profile=cmoy"). Handle it specially only if it's the top-level --profile option.
* input: fix dangling pointer issues with multi-part commandswm42013-07-241-5/+8
| | | | | | | This didn't setup the linked list of sub-commands for multi-part commands ("a ; b ; c") correctly. Also, the new commands were attached to the allocation of the _old_ command instead of the new one. (Wow, whatever the hell I was (not) thinking when I wrote this code.)
* demux_lavf: set keyframe flag on attached pictureswm42013-07-241-0/+1
| | | | | | | | | Gives really funky results with PNG attachments otherwise. The main problem is that avcodec_flush_buffers() does not fully reset the decoder, so passing multiple PNG packets without keyframe flags will attempt to combine the new picture with the previously decoded contents. (Makes no sense with proper PNG - maybe this codepath is intended for MNG or APNG.)
* mplayer: remove dead codewm42013-07-241-2/+0
| | | | | Attached pictures are now handled specially and on a separate codepath, so this hack is not needed anymore. Remove it from the normal codepath.
* Fix some -Wshadow warningswm42013-07-2326-96/+86
| | | | | | In general, this warning can hint to actual bugs. We don't enable it yet, because it would conflict with some unmerged code, and we should check with clang too (this commit was done by testing with gcc).
* options: make legacy hacks for AFs/VFs more explicitwm42013-07-224-1/+5
| | | | | This means that AOs/VOs with no options set do not take the legacy option parsing path, but instead report that they have no options.
* audio/out: remove options argument from init()wm42013-07-2216-31/+18
| | | | Same as with VOs in the previous commit.
* video/out: remove options argument from preinit()wm42013-07-2214-26/+16
| | | | | All VOs use proper option parsing now, and compatibility hacks are not needed.
* Remove subopt-helperwm42013-07-228-409/+3
| | | | Finally not used by anything anymore. Farewell.
* ao_coreaudio: fix ifdef'd conditionalStefano Pigozzi2013-07-221-1/+1
| | | | | The big endian case was not covered. Doesn't make much difference since mpv runs on Macs with x86 only, but for the sake of correctness.
* ao_coreaudio: use new option APIStefano Pigozzi2013-07-221-38/+22
|
* ao_coreaudio: switch properties getters to tallocStefano Pigozzi2013-07-223-18/+19
|
* ao_coreaudio: reduce verbosity of the chmapping codeStefano Pigozzi2013-07-221-2/+2
|
* ao_coreaudio: revert to original device format on digital uninitStefano Pigozzi2013-07-221-3/+11
| | | | | | This is not done automatically by CoreAudio. I am told that it would a PITA to have to switch back the format manually on the device (especially if the same device is used for lpcm output).
* ao_coreaudio: refactor chmap detectionStefano Pigozzi2013-07-223-91/+96
| | | | | | b2f9e0610 introduced this functionality with code that was quite 'monolithic'. Split the functionality over several functions and ose the new macros to get array properties.
* ao_coreaudio: refactor properties codeStefano Pigozzi2013-07-224-146/+111
| | | | | | | | Introduce some macros to deal with properties. These allow to work around the limitation of CoreAudio's API being `void **` based. The macros allow to keep their client's code DRY, by not asking size and other details which can be derived by the macro itself. I have no idea why Apple didn't design their API like this in the first place.
* ao_coreaudio: move utils functions to snake_caseStefano Pigozzi2013-07-223-39/+34
|
* ao_coreaudio: split ao_coreaudio_common in two filesStefano Pigozzi2013-07-226-161/+290
| | | | | | | | | * ao_coreaudio_utils: contains several utility function * ao_coreaudio_properties: contains functions to set and get audio object properties. Conflicts: audio/out/ao_coreaudio.c
* ao_coreaudio: store asbd only when selectedStefano Pigozzi2013-07-221-4/+1
| | | | | Previous code needlessly stored the input asbd before actually testing it's support against the hardware.
* ao_coreaudio: fallback to waveext on non surround inputsStefano Pigozzi2013-07-221-3/+3
|
* ao_coreaudio: set channel layout based on hardware queryStefano Pigozzi2013-07-221-2/+106
| | | | this is a wip
* ao_coreaudio: fix regression in digital stream selectionStefano Pigozzi2013-07-221-1/+1
| | | | | | The condition was checked wrongly on asbd which is the input format description. This lead to the condition always being true, thus selecting lpcm streams for digital input.
* ao_coreaudio: return errors instead false in init functionsStefano Pigozzi2013-07-221-3/+3
|
* ao_coreaudio: remove useless function declarationStefano Pigozzi2013-07-221-3/+0
|
* ao_coreaudio: only set chmap_sel info for lpcmStefano Pigozzi2013-07-221-5/+7
|
* ao_coreaudio: set channel layout bitmapStefano Pigozzi2013-07-221-1/+17
|
* ao_coreaudio: move digital detection before asbd creationStefano Pigozzi2013-07-221-10/+9
|
* ao_coreaudio: remove chmap selection if format is digitalStefano Pigozzi2013-07-221-1/+0
|
* ao_coreaudio: remove volume multiplication by 4Stefano Pigozzi2013-07-221-2/+2
| | | | | kHALOutputParam_Volume is the linear gain so it should be at maximum 1 to keep the audio quality good. No idea why it was more than that.
* ao_coreaudio: remove device property listener on uninitStefano Pigozzi2013-07-222-12/+32
| | | | Also extract this functionality inside a function in coreaudio_common
* ao_coreaudio: print help string in one goStefano Pigozzi2013-07-221-5/+11
|
* ao_coreaudio: change all ++var to var++Stefano Pigozzi2013-07-222-12/+8
| | | | |