Micah Galizia
489c09ad4b
add locale month names to av_small_strptime
...
Signed-off-by: Micah Galizia <micahgalizia@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Marton Balint
593987810e
avutil/parseutils: dont assume standard time when parsing a timestamp
...
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
8 years ago
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.
9 years ago
Michael Niedermayer
54f43984e1
avutil/parseutils: mark args as static const
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Petru Rares Sincraian
f707042c93
Added more tests to libavutil/parseutils.c
...
- Added tests for av_find_info_tag().
- Added test for av_get_known_color_name()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Petru Rares Sincraian
68e5976543
Refactor libavutil/parseutils.c
...
All tests were in the main method which produces a long main. Now, each test
is in his own method.
I think this produces a more clear code and follows more with the main
priority of FFmpeg "simplicity and small code size"
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Diego Biurrun
a84713e70d
parseutils-test: Move some variable declarations to avoid block braces
9 years ago
Marton Balint
ae51f9bd6c
avutil/parseutils: remove 2112 date from fate test
...
It is not supported on 32bit.
Signed-off-by: Marton Balint <cus@passwd.hu>
9 years ago
Marton Balint
f834f0cab6
avutil/parseutils: accept everything in av_parse_time that ff_iso8601_to_unix_time accepts
...
Also parse timezone information previously ignored in ff_iso8601_to_unix_time.
Signed-off-by: Marton Balint <cus@passwd.hu>
9 years ago
Marton Balint
3235241061
avutil/parseutils: use microsecond precision when parsing "now" in av_parse_time()
...
Use av_gettime() instead of time(0) for querying current time.
Signed-off-by: Marton Balint <cus@passwd.hu>
9 years ago
Luca Barbato
219b39a71a
parseutil: Use non ambiguous aliases for uhd
...
uhd1 and uhd2 would be ambigous.
9 years ago
Luca Barbato
e93ca480c9
parseutil: Add more resolution aliases
...
Add DCI 2k and 4k and uhd1 and uhd2.
9 years ago
Luca Barbato
27f2746282
parseutils: Make av_small_strptime public
...
And use it in libavformat.
Based on a similar patch by Stefano Sabatini <stefasab@gmail.com>.
10 years ago
Luca Barbato
108f2f381a
parseutils: Extend small_strptime to be used in avformat
...
The strptime implementation is supposed to support whitespace and %T.
10 years ago
Diego Biurrun
bf704132a5
Don't anonymously typedef structs
10 years ago
Martin Storsjö
82ee7d0dda
Use gmtime_r instead of gmtime and localtime_r instead of localtime
...
gmtime isn't thread safe in general. In msvcrt (which lacks gmtime_r),
the buffer used by gmtime is thread specific though.
One call to localtime is left in avconv_opt.c, where thread safety
shouldn't matter (instead of making avconv depend on the libavutil
internal header).
Signed-off-by: Martin Storsjö <martin@martin.st>
10 years ago
Vittorio Giovara
6b45f05ef5
parseutils: fix discarding const attribute warning
11 years ago
Stefano Sabatini
d61617a523
lavu/parseutils: add av_get_known_color_name()
11 years ago
Niv Sardi
49ba6e56bd
lavu/parseutils: add more resolutions
...
See http://en.wikipedia.org/wiki/Graphics_display_resolution
Signed-off-by: Niv Sardi <xaiki@evilgiggle.com>
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
11 years ago
Michael Niedermayer
2215947438
avutil/parseutils:make const tables static const
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Carl Eugen Hoyos
de4811e910
Force using a 64bit intermediate when calculating calendar time with av_timegm().
...
Fixes a fate failure with icc 13.1
12 years ago
Reimar Döffinger
efa7f42020
Use the avstring.h locale-independent character type functions
...
Make sure the behavior does not change with the locale.
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Reimar Döffinger
88d55b827d
Remove incorrect use of ctype.h functions.
...
As far as I can tell the code should not change behaviour
depending on locale in any of these places.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
12 years ago
Senthilnathan M
12a269a522
lavu/parseutils: allow MM:SS format for duration in av_parse_time()
...
Fix trac ticket #2258 .
Signed-off-by: Senthilnathan M <senthilnathan.maadasamy@gmail.com>
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
12 years ago
Dave Rice
71956371a7
lavu/parseutils: add digital cinema frame sizes
...
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
12 years ago
Anton Khirnov
cb45553f57
Remove pointless #undefs of previously forbidden functions.
12 years ago
Nicolas George
86a2486812
lavu/parseutils: accept %J for hours >= 24.
...
Allow to parse durations >= 24:00:00.
12 years ago
Stefano Sabatini
d4604d10fe
lavu/parseutils: add trailing characters check in av_parse_video_size()
...
Return an error in case the video size specifications contains spurious
trailing chars, like in "320x240foobar".
12 years ago
Stefano Sabatini
b6e36a4244
lavu/parseutils: remove unused gcd variable in av_parse_ratio()
...
Fix warning.
12 years ago
Stefano Sabatini
cdea54b4c8
lavu/parseutils: rework rational reduction logic in av_parse_ratio()
...
Avoid to divide num and den by gcd in case of a parsed expression, since
that is already done in av_d2q(), and force reduction in case of "a:b"
form, allowing to honour the max parameter.
The latter change is consistent with the a/b case, and with the
documentation.
12 years ago
Mans Rullgard
15ba7f6525
parseutils: fix const removal warning
...
The const qualifier is still removed although it happens inside
the strtol() function so no warning is generated.
Fixes:
libavutil/parseutils.c:110:11: warning: assignment discards qualifiers from pointer target type
Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years ago
Mans Rullgard
68e360a83c
parseutils-test: various cleanups
...
- make tables static const
- remove useless use of compound literal
- break long lines
- fix a comma/semicolon typo
Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years ago
Mans Rullgard
41e46a5fba
parseutils-test: do not print numerical error codes
...
The error codes differ between systems so printing the value makes
the fate test fail on some systems.
Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years ago
Mans Rullgard
6221e2478c
parseutils: fix parsing of invalid alpha values
...
An alpha specifier outside the valid range results in a conversion from
double to long with undefined result. Range-checking the double and
only converting it after it passes avoids this.
Fixes fate-parseutils errors on some systems.
Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years ago
Diego Biurrun
c010fce6c9
parseutils-test: Drop random colors from parsing test
...
This guarantees stable output for comparing test results.
12 years ago
Stefano Sabatini
1ad63ff14a
fate: add av_small_strptime() test to fate-parseutils
12 years ago
Stefano Sabatini
85c93d90df
lavu/parseutils: fix av_small_strptime() whitespace directive parsing
...
According to POSIX, strptime() should consume whitespaces in the date
string everytime a whitespace conversion specification is found in the
date format specification. Make av_small_strptime() conform with this
behavior.
In particular, should fix trac ticket #1739 .
12 years ago
Stefano Sabatini
29e972f67c
lavu/parseutils: add av_small_strptime()
...
Make internal small_strptime() function public, and use it in place of
strptime().
This allows to avoid a dependency on strptime() on systems which do not
support it.
In particular, fix trac ticket #992 .
12 years ago
Stefano Sabatini
79dcd58d83
lavu/parseutils: make small_strptime() return a (non const) char *
...
This is consistent with the standard definition of strptime().
12 years ago
Martin Storsjö
1d9c2dc89a
Don't include common.h from avutil.h
...
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Nicolas George
5a9d6993cb
parseutils: ignore digits below the microsecond.
...
Accept 1.1234567 as simply 1.123456 instead of rejecting it.
The rounding is towards 0, which is acceptable and much simpler.
13 years ago
Paul B Mahol
61123fb8f7
parseutils: fix sorting of colors
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 years ago
Mans Rullgard
6501dcfb5e
Remove unnecessary inclusions of [sys/]time.h
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
13 years ago
Stefano Sabatini
3ecaba677e
tests/parseutils: change test to make it platform independent
...
Make the test independent from the actual error string used to describe a
certain error code.
13 years ago
Michael Niedermayer
f8b536a786
parseutils: use strings instead of integers for error codes.
...
error values can differ between platforms.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
9501b93241
parseutils: fix ;/, error
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Nicolas George
3e1d3ebf5e
parseutils: replace setenv() by putenv().
...
putenv() seems to be more portable.
13 years ago
Reimar Döffinger
2b336df3cb
parseutils: reliably detect out-of-range alpha.
...
This should fix the FATE test on ARM (not tested),
but it should also detect alpha values like 2^128
reliably as invalid which would be another out-of-range
case with implementation-dependant behaviour.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
13 years ago
Nicolas George
9b84f8a987
parseutils: add av_parse_time() test.
13 years ago
Nicolas George
43b7068070
parseutils: make av_parse_time() check for failure.
...
Until now, av_parse_time() would accept "1:00" as "1"
and silently ignore ":00".
This patch also includes a few cosmetic changes.
13 years ago