summaryrefslogtreecommitdiffstats
path: root/m_option.c
Commit message (Collapse)AuthorAgeFilesLines
* libmpcodecs: support planar GBR24 decodingcehoyos2012-03-251-0/+1
| | | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34245 b3059339-0415-0410-9bf9-f77b7e298cf2 Note: ffmpeg first introduced PIX_FMT_GBR24P, which was used in this commit. Later, it was renamed to PIX_FMT_GBRP in ffmpeg and libav. This was updated in revision 34492 in mplayer, but the mplayer specific names (such as IMGFMT_GBR24) were left unchanged.
* options: allow choice options without parameterwm42012-01-181-8/+15
| | | | | | | | | | | If an m_option_type_choice option is declared with M_OPT_IMPLICIT_DEFAULT in its flags, it doesn't require a parameter. For example, if --opt is such an option, it can be invoked as "--opt=val", "-opt", or "--opt". The last two will set the option to the first choice the option declares. Note that "-opt val" (using the old option syntax) is not allowed in this case, as it would be ambiguous. Normal option parsing should be unaffected.
* options: make "choice" option type parsing ignore caseUoti Urpala2011-09-111-1/+1
|
* options: commandline: don't print video filter list twiceUoti Urpala2011-07-311-14/+14
| | | | | | | | | Video filter help output was printed twice since it used a MSGT type that was not suppressed during preparsing. Fix. This removes a "ID_VIDEO_FILTERS" line that was printed --identify, but I'm not aware of anything using that and other things like audio filters have no such ID_ output either. Also change some printf() calls to mp_msg() in code printing filter-specific help.
* options: fix failure to parse trailing ',' in string listUoti Urpala2011-07-311-2/+4
| | | | | | A trailing separator in string list options was ignored after recent commit e873d703e9 ("options: change option parsing to use bstr"), which broke uses such as "-vo vdpau,". Fix.
* options: commandline: print error type for parse failuresUoti Urpala2011-07-291-0/+18
| | | | | | | | | | | | If parsing an option fails, print a string corresponding to the parse function return value (M_OPT_MISSING_PARAM etc). The primary motivation is that the parsing code already outputs messages explaining most problems, but does not itself print anything in the missing parameter case. Before double-dash --options such errors were rare (or rather they resulted in the next commandline argument being silently misinterpreted as an argument to the previous option instead); but now an argument like "--ss" should give a better indication about the problem than just "Error parsing option".
* options: change option parsing to use bstrUoti Urpala2011-07-291-592/+501
| | | | | | Using bstr allows simpler parsing code, especially because it avoids the need to modify or copy strings just to terminate extracted substrings.
* options: indicate ambiguous option parameters explicitlyUoti Urpala2011-07-291-33/+32
| | | | | | | | Command line options like "-foo xyz" are ambiguous: "xyz" may be a parameter to the option "foo" or an unrelated argument. Instead of relying on the struct m_config mode field (commandline/file) pass parameters to specify ambiguous mode explicitly. Meant for "--foo" options which are never ambiguous on command line either.
* Merge branch 'mplayer1_changes'Uoti Urpala2011-07-061-0/+1
|\
| * options: allow colorspace options to recognize "yvyu"reimar2011-07-061-0/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33693 b3059339-0415-0410-9bf9-f77b7e298cf2
* | options: allocate dynamic options with tallocUoti Urpala2011-07-061-97/+80
|/ | | | | | | | | Allocate data structures for dynamic option values with talloc. Hopefully there's no code left that tries to modify those dynamic option values outside the option parser and relies on them being malloc-allocated. Currently talloc functionality isn't used much and the allocations are not hierarchical, so the main practical use for now is just to allow very easy checking for memory leaks.
* commands: change property mechanism to use talloc stringsUoti Urpala2011-07-031-49/+15
|
* cosmetics: reformat demux_lavf.c, m_option.[ch] and m_property.cUoti Urpala2011-07-031-1743/+1908
|
* video/colorspaces: add new 9/10-bit formats from libavcodecUoti Urpala2011-06-261-0/+15
| | | | | | | Add new internal 9/10-bit IMGFMT values and mappings to the corresponding libav* PIX_FMT_* values. Partially based on a patch from Arne Bochem <arneb.mp@ccan.de>.
* options: fix -profile parsing after 2db33ab48cUoti Urpala2011-05-071-1/+3
| | | | | | | | | | | | | | Commit 2db33ab48cfa785 ("options: support string list separators other than ','") started using the "priv" field in options of string list type to store the separator character. However, the "profile" option has a custom type which uses the same parsing function but uses the "priv" field for another purpose. As a result "-profile" parsing used a "random" character as the separator instead of ','; at least uses which depended on ',' working were likely to fail, and if the separator used happened to be a character occurring in the profile name then any use of -profile could break. Fix by adding a check in the parsing function to only read the priv field if the option type is normal string list.
* cleanup: shut up more warningsClément Bœsch2011-05-061-2/+3
|
* options: support string list separators other than ','Uoti Urpala2011-04-201-5/+4
| | | | | | Allow specifying a custom separator character for options of string list type, and use that to define OPT_PATHLIST which takes a list of strings separated by ':' (or ';' on Windows).
* options: remove unused "func_full" option typeUoti Urpala2011-01-311-29/+2
| | | | | | vo_zr was the last user of the "func_full" option type. I think it's better if future features are implemented using more straightforward option functionality. Delete the func_full implementation.
* options: add special -leak-report optionUoti Urpala2011-01-151-1/+1
| | | | | | | | | | | | Add a special option "-leak-report" that enables talloc leak reporting. It only works if it's given as the first argument. The code abuses the CONF_TYPE_PRINT option type to make main option parsing ignore the option. The parser incorrectly consumed the following commandline argument as a "parameter" for options of this type when they had the flag to not exit after printing the message. Fix this. It makes no difference for any previously existing option I think.
* Merge branch 'hr-seek'Uoti Urpala2010-12-201-0/+44
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * hr-seek: input: add default keybindings Shift+[arrow] for small exact seeks input: support bindings with modifier keys for X input core: audio: make ogg missing audio timing workaround more complex core: add support for precise non-keyframe-limited seeks core: add struct for queued seek info commands: add generic option -> property wrapper options: add "choice" option type, use for -pts-association-mode core: remove looping in update_video(), modify command handling a bit core: seek: use accurate seek mode with audio-only files core: avoid using sh_video->pts as "current pts" libvo: register X11 connection fd in input event system core: timing: add special handling of long frame intervals core: move central play loop to a separate function Conflicts: DOCS/tech/slave.txt
| * options: add "choice" option type, use for -pts-association-modeUoti Urpala2010-12-181-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | Add a "choice" option type. Options of this type take a string as input and set an int option variable to the value corresponding to the string. The string->int mapping is option-specific and is given in the option definition. Strings not found in the mapping are rejected as invalid option values. Change the option -pts-association-mode to use this new option type and accept values "auto, decoder, sort" instead of "0, 1, 2". The change in accepted values shouldn't cause problems as this option is not appropriate to use in normal user config files.
* | cosmetics: remove unused code, small formatting tweaksUoti Urpala2010-12-201-1/+1
|/
* cleanup: don't check for NULL before free()diego2010-11-081-6/+5
| | | | | | patch by Clément Bœsch, ubitux gmail com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32598 b3059339-0415-0410-9bf9-f77b7e298cf2
* options: modify parse_timestring(), make publiccigaes2010-11-021-12/+16
| | | | | | | | Make the parse_timestring public, with a slightly extended API. As a consequence, "2 hours" is no longer recognized as a valid timestamp meaning "2 seconds". git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32514 b3059339-0415-0410-9bf9-f77b7e298cf2
* Move code to avoid forward declarations in top-level .c filesdiego2010-11-021-19/+17
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32421 b3059339-0415-0410-9bf9-f77b7e298cf2
* spelling fixessiretart2010-11-021-1/+1
| | | | | | | | | | Found by the Debian QA tool 'lintian' git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31913 b3059339-0415-0410-9bf9-f77b7e298cf2 reintroduce typo in genres.h that was fixed fixed r31913 to match the id3v2 spec git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31920 b3059339-0415-0410-9bf9-f77b7e298cf2
* m_option.c: fix list termination with -*-pre optionsreimar2010-11-021-2/+4
| | | | | | | | Ensure that e.g. -af-pre will not cause the filter list to be unterminated when the list was empty before. Should fix bug #1687. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31559 b3059339-0415-0410-9bf9-f77b7e298cf2
* Merge svn changes up to r31141Uoti Urpala2010-05-071-0/+2
|\
| * Add support for 12-bit color mode on framebuffer devices.cehoyos2010-05-061-0/+2
| | | | | | | | | | | | | | Patch Janusz Krzysztofik, jkrzyszt A tis icnet pl git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31139 b3059339-0415-0410-9bf9-f77b7e298cf2
* | options: move -chapter values to option structUoti Urpala2010-04-251-0/+46
| | | | | | | | | | | | | | | | | | | | | | -chapter can optionally take a range with a start and an end. Add a new option type which supports such values and use that instead of a custom per-option function. This commit also fixes a build configuration bug: before the availability of the -chapter option depended on DVD functionality being enabled in the binary, even though the option works with other sources too.
* | Merge svn changes up to r30748Uoti Urpala2010-03-101-30/+30
|\|
| * Do not cast the results of malloc/calloc/realloc.diego2010-02-261-1/+1
| | | | | | | | | | | | | | | | These functions return void*, which is compatible with any pointer, so there is no need for casts. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30744 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Make more option-parsing related function arguments const.reimar2010-02-251-29/+29
| | | | | | | | | | | | | | Prerequisite for making stream_open filename const in a proper way. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30737 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30475Uoti Urpala2010-03-091-0/+17
|\|
| * Add license header to all top-level files missing them.diego2010-01-301-0/+17
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30471 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Make help text translatableUoti Urpala2010-03-071-1/+1
| | | | | | | | | | | | Translate help_text and also make all CONF_TYPE_PRINT option output translatable (though no translations exist yet for anything other than the main help text).
* | Merge svn changes up to r30301Uoti Urpala2010-01-251-1/+3
|\|
| * Add support for distinguishing between little- and big-endian SPDIF AC3reimar2010-01-111-1/+3
| | | | | | | | | | | | | | and converting between both. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30283 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30165Uoti Urpala2010-01-081-0/+11
|\|
| * Add support for YUV format with alpha and fix the codecs.conf entry for vp6areimar2009-12-311-0/+1
| | | | | | | | | | | | | | | | to use it. Fixes playback of samples in http://samples.mplayerhq.hu/FLV/flash_with_alpha/ git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30157 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Add support for 16-bit per component YUV formats.reimar2009-12-311-0/+9
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30152 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Add support for 440p colorspace.reimar2009-12-301-0/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30140 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r29962Uoti Urpala2009-11-231-0/+3
|\|
| * Support 16-bit-per-component RGB formats (rgb48[bln]e) in option parser.reimar2009-11-211-0/+3
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29942 b3059339-0415-0410-9bf9-f77b7e298cf2
| * whitespace cosmetics: Remove all trailing whitespace.diego2009-05-131-54/+54
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Remove trailing whitespace from most filesUoti Urpala2009-07-071-54/+54
| |
* | Merge svn changes up to r28862Uoti Urpala2009-03-071-5/+24
|\|
| * 100l, remove a pointless opt = NULL assignment that made print_int crash ↵reimar2009-03-031-1/+0
| | | | | | | | | | | | since r28794 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28803 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Add a 64 bit integer type to the suboption parser.reimar2009-03-021-1/+21
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28794 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Use strtoll in parse_int to avoid discrepancies between 32 and 64 bit systems.reimar2009-03-021-3/+3
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28793 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Minor cosmetics: fix indentationreimar2009-03-021-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28792 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r27899Uoti Urpala2008-11-061-1/+2
|\|
| * Avoid a potential memleak in parse_obj_params in case of a missingreimar2008-10-311-1/+2
| | | | | | | | | | | | m_ob_params_t part. Fixes bug #1318. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27869 b3059339-0415-0410-9bf9-f77b7e298cf2
* | options: Fix multiple -v by simplifying CONF_TYPE_FUNCUoti Urpala2008-04-261-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | The CONF_TYPE_FUNC implementation counted how many times the option had appeared and called the function that many times when it was set. However each -v on the command line triggered an increase of the count _and_ as many calls as the current count indicated. Thus the resulting verbosity levels for 0 to 5 -v were really 0, 1, 3, 6, 10, 15 instead of 0, 1, 2, 3, 4, 5. Remove the counting functionality and just call the given function once at each set operation. This fixes -v; other options are not affected.
* | options: Remove "reset" functionality from CONF_TYPE_FUNC[_PARAM]Uoti Urpala2008-04-261-3/+0
|/ | | | | | The "reset to default before setting to something else" functionality is not used by any current option, but prevents using the "priv" field of the option data for anything else.
* typo: begining --> beginningdiego2007-12-231-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25517 b3059339-0415-0410-9bf9-f77b7e298cf2
* Option print functions may not and do not modify valuereimar2007-12-021-7/+7
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25257 b3059339-0415-0410-9bf9-f77b7e298cf2
* correct const usage in the option handling code so that tables can berfelker2007-11-091-78/+78
| | | | | | | declared const and moved from .data to .text/rodata sections. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24994 b3059339-0415-0410-9bf9-f77b7e298cf2
* Avoid code duplication and ugly config.h hack by using av_strlcat/av_strlcpyreimar2007-07-051-4/+5
| | | | | | | instead of plain strlcat/strlcpy git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23723 b3059339-0415-0410-9bf9-f77b7e298cf2
* mjpeg support for v4l2 tv:// drivervoroshil2007-06-011-0/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23441 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add a print function for the time option type.albeu2007-05-311-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23433 b3059339-0415-0410-9bf9-f77b7e298cf2
* remove C99-ism (mixed declaration and code),gpoirier2007-02-281-1/+3
| | | | | | | | 10l to Uoti Urpala for breaking GCC-2.95 support yet again even though any post-2.95 GCC version print a clear warning about it Patch by Carl Eugen Hoyos % cehoyos A ag P or P at % git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22374 b3059339-0415-0410-9bf9-f77b7e298cf2
* Move parsing of the -ss option to the option code.uau2007-02-241-11/+48
| | | | | | | Also fixes a memory leak of the parameter string. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22330 b3059339-0415-0410-9bf9-f77b7e298cf2
* str_list separator backslash-escapingreimar2007-02-051-10/+18
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22151