Carl Eugen Hoyos
cd01b3cbcf
lavu/opt: Use "&&" instead of "*" in boolean expression.
...
Fixes the following warning:
libavutil/opt.c:101:47: warning: '*' in boolean context, suggest '&&' instead
2017-10-08 23:15:53 +02:00
Clément Bœsch
03f5e80bdb
Merge commit '67351924fa91dea4339109100a4c0689f006581f'
...
* commit '67351924fa91dea4339109100a4c0689f006581f':
Drop unreachable break and return statements
Merged-by: Clément Bœsch <cboesch@gopro.com>
2017-03-30 10:26:29 +02:00
Andreas Cadhalpun
3ab8436ff6
opt: reject denominator zero as out of range
...
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-12-13 00:00:31 +01:00
Michael Niedermayer
2f935baa7d
avutil/opt: Add AV_OPT_TYPE_UINT64
...
Requested-by: wm4 ([FFmpeg-devel] [PATCH] avutil/opt: Support max > INT64_MAX in write_number() with AV_OPT_TYPE_INT64)
Requested-by: ronald ([FFmpeg-devel] [PATCH] avutil/opt: Support max > INT64_MAX in write_number() with AV_OPT_TYPE_INT64)
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-23 02:01:05 +01:00
Michael Niedermayer
748ce9d702
avutil/opt: Fix setting int64 to its maximum
...
Found-by: Andreas
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-20 22:39:52 +01:00
Diego Biurrun
67351924fa
Drop unreachable break and return statements
2016-11-03 20:17:12 +01:00
Michael Niedermayer
37bb600405
avutil/opt: Fix max/min checking in av_opt_set() for AV_OPT_TYPE_VIDEO_RATE
...
Fixes Ticket5618
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-09 10:35:13 +02:00
Derek Buitenhuis
96d616052b
Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13'
...
* commit 'd12b5b2f135aade4099f4b26b0fe678656158c13':
build: Split test programs off into separate files
Some conversions done by: James Almer <jamrial@gmail.com>
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-05-11 19:13:03 +01:00
Przemysław Sobala
1a3cff4f7e
libavutil/opt: add writing AV_OPT_TYPE_VIDEO_RATE AVOption
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-05-09 15:01:31 +02:00
Muhammad Faiz
83065939cb
avutil/parsing: add '\r' as whitespace
...
for compatibility with platforms that treat it
as newline
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2016-05-06 07:35:45 +07:00
Derek Buitenhuis
5f587b1daf
Merge commit '3b08d9d932eef09403074d5af31e10d8011e840b'
...
* commit '3b08d9d932eef09403074d5af31e10d8011e840b':
testprogs: K&R formatting cosmetics
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-21 16:50:06 +01:00
Derek Buitenhuis
e344646c80
Merge commit '564b4591bbe223bdc5f36a1131eaef103f23f5d0'
...
* commit '564b4591bbe223bdc5f36a1131eaef103f23f5d0':
opt: Add av_opt_copy()
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-19 19:19:53 +01:00
Diego Biurrun
d12b5b2f13
build: Split test programs off into separate files
...
This avoids spurious library rebuilds when only the test program
code is changed and simplifies the build system.
2016-04-07 16:14:42 +02:00
Diego Biurrun
3b08d9d932
testprogs: K&R formatting cosmetics
2016-03-24 21:45:07 +01:00
Michael Niedermayer
564b4591bb
opt: Add av_opt_copy()
...
This includes documentation and other modifications by
Lukasz Marek and Martin Storsjö.
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-03-24 10:34:15 +02:00
Lukasz Marek
8833f1508b
opt: Add const to av_opt_next
...
Also add const to pointers in static functions within opt.c where
possible/necessary.
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-03-24 10:34:09 +02:00
Diego Biurrun
0d2fcdb1c5
opt-test: Merge struct declaration and initialization
2016-03-23 10:14:43 +01:00
Diego Biurrun
d3044cf37f
opt-test: Move some variable declarations to avoid block braces
2016-03-23 10:14:31 +01:00
Michael Niedermayer
f3ace85d88
avutil/opt: check for and handle errors in av_opt_set_dict2()
...
Previously errors could result in random entries to be lost.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-26 17:36:08 +01:00
Nicolas George
47ea04ff10
lavu/opt: enhance printing durations.
...
Trim unneeded leading components and trailing zeros.
Move the formating code in a separate function.
Use the function also to format the default value, it was currently
printed as plain integer, inconsistent to the way it is parsed.
2015-11-07 16:04:09 +01:00
Clément Bœsch
6b5412cbfa
avutil/opt: print more meaningful default flags values
...
Example:
% ./ffmpeg -h encoder=gif
[...]
GIF encoder AVOptions:
-gifflags <flags> E..V.... set GIF flags (default offsetting+transdiff)
offsetting E..V.... enable picture offsetting
transdiff E..V.... enable transparency detection between frames
2015-10-25 22:47:16 +01:00
Clément Bœsch
ce0a117ed4
avutil/opt: display a better default value for int/int64 options
...
Example:
% ./ffmpeg -h encoder=aac
-aac_coder <int> E...A... Coding algorithm (from -1 to 3) (default twoloop)
faac E...A... FAAC-inspired method
anmr E...A... ANMR method
twoloop E...A... Two loop searching method
fast E...A... Constant quantizer
[...]
2015-10-19 00:04:33 +02:00
Rodger Combs
0562f95902
lavu/opt: add flag to return NULL when applicable in av_opt_get
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-09 04:12:57 -05:00
Clément Bœsch
9571a56009
avutil/opt: refactor pixel/sample fmt common case
2015-09-08 22:49:33 +02:00
Clément Bœsch
9117748cff
avutil/opt: add AV_OPT_TYPE_BOOL
2015-09-08 22:39:20 +02:00
Hendrik Leppkes
d83dd630a0
lavu: Drop FF_API_GET_CHANNEL_LAYOUT_COMPAT cruft
...
FATE refs changed to accomodate for the new default behavior of the function.
Numbers are now interpreted as a channel layout, instead of a number of channels.
2015-09-05 20:36:19 +02:00
Hendrik Leppkes
237cf3786e
lavu: Drop old deprecated AVOption API
...
Deprecated in 2011/10
2015-09-05 18:30:35 +02:00
Hendrik Leppkes
545559e43d
Remove FF_CONST_AVUTIL55 cruft
2015-09-05 17:56:28 +02:00
Ronald S. Bultje
3285005347
Undeprecate av_opt_set_defaults2().
2015-08-18 13:09:06 -04:00
Michael Niedermayer
52835cb8e1
avutil/opt: Avoid division by 0
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-03 16:37:04 +02:00
Michael Niedermayer
6d7e57e88b
avutil/opt: Do not print inf in selftest
...
This fixes fate failures on windows
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-05 13:50:22 +01:00
Michael Niedermayer
88ec5435bb
avutil/opt: also test av_opt_show2()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-01 17:45:32 +01:00
Michael Niedermayer
e9c85ae648
avutil/opt: Remove odd trailing whitespace bytes from flags help description
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-01 17:29:33 +01:00
Michael Niedermayer
c1e93cdc9e
avutil/opt: Also test/compare the av_log output i the selftest
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-01 17:04:12 +01:00
Michael Niedermayer
1750b45cdf
avutil/opt: Fix type used to access AV_OPT_TYPE_SAMPLE_FMT
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-06 22:16:08 +01:00
Michael Niedermayer
a0640e6346
avutil/opt: Fix types used to access AV_OPT_TYPE_PIXEL_FMT
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-06 22:15:20 +01:00
Michael Niedermayer
b20e79dbe9
Merge commit '07a0c0f0005072d115ace61e60f46be68582cc3a'
...
* commit '07a0c0f0005072d115ace61e60f46be68582cc3a':
opt: check memory allocation
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-06 21:37:48 +01:00
Vittorio Giovara
07a0c0f000
opt: check memory allocation
...
CC: libav-stable@libav.org
Bug-Id: CID 1257771
2015-01-05 14:58:20 +01:00
Michael Niedermayer
988d27b802
Merge commit 'b1306823d0b3ae998c8e10ad832004eb13bdd93e'
...
* commit 'b1306823d0b3ae998c8e10ad832004eb13bdd93e':
check memory errors from av_strdup()
Conflicts:
avprobe.c
libavformat/matroskaenc.c
libavutil/opt.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-19 04:57:25 +01:00
Vittorio Giovara
b1306823d0
check memory errors from av_strdup()
2014-12-18 23:27:14 +01:00
Michael Niedermayer
41a52740d4
avutil/opt: Fix AV_OPT_TYPE_BINARY case in av_opt_is_set_to_default()
...
Fixes CID1257010
Reviewed-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 15:39:17 +01:00
Michael Niedermayer
ace9161655
avutil/opt: Check av_parse_video_rate()s return value
...
Fixes CID1257008
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-07 02:57:39 +01:00
Michael Niedermayer
eb74839caa
avutil/opt: Check av_parse_color() return value
...
Fixes: CID1257007
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-07 02:46:25 +01:00
Lukasz Marek
0cb994dfe3
lavu/opt: add escaping to av_opt_serialize
...
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
2014-11-29 00:58:42 +01:00
Lukasz Marek
f00e9c4b10
lavu/opt: add consts where possible
2014-11-27 23:27:14 +01:00
Lukasz Marek
ea0d893817
lavu/opt: handle NULL obj in av_opt_next
...
It indirectly also fixes av_opt_free for NULL objs.
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
2014-11-25 23:09:16 +01:00
Lukasz Marek
bee5844ddd
lavu/opt: introduce av_opt_serialize()
...
Function allows to create string containing object's serialized options.
Such string may be passed back to av_set_options_string() in order to restore options.
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
2014-11-16 01:13:38 +01:00
Lukasz Marek
eec693328a
lavu/opt: introduce av_opt_is_set_to_default()
...
New function allows to check if option is set to its default value
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
2014-11-16 01:13:38 +01:00
Lukasz Marek
173d51c982
lavu/opt: fix av_opt_get function
...
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
2014-11-12 23:34:05 +01:00
Lukasz Marek
5dc0f607e7
lavu/opt: fix memleak in test
...
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
2014-11-12 23:32:31 +01:00