mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-29 22:00:58 +02:00
Merge commit '27f274628234c1f934b9a6a6380ed567c1b4ceae'
* commit '27f274628234c1f934b9a6a6380ed567c1b4ceae': parseutils: Make av_small_strptime public Conflicts: doc/APIchanges libavformat/utils.c libavutil/parseutils.c libavutil/version.h See: 29e972f67c914d35417bc7368493d2617abdd26e Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
9c37c81246
@ -4079,8 +4079,8 @@ int64_t ff_iso8601_to_unix_time(const char *datestr)
|
||||
{
|
||||
struct tm time1 = { 0 }, time2 = { 0 };
|
||||
char *ret1, *ret2;
|
||||
ret1 = av_small_strptime(datestr, "%Y - %m - %d %H:%M:%S", &time1);
|
||||
ret2 = av_small_strptime(datestr, "%Y - %m - %dT%H:%M:%S", &time2);
|
||||
ret1 = av_small_strptime(datestr, "%Y - %m - %d %T", &time1);
|
||||
ret2 = av_small_strptime(datestr, "%Y - %m - %dT%T", &time2);
|
||||
if (ret2 && !ret1)
|
||||
return av_timegm(&time2);
|
||||
else
|
||||
|
@ -145,32 +145,6 @@ const char *av_get_known_color_name(int color_idx, const uint8_t **rgb);
|
||||
*/
|
||||
int av_parse_time(int64_t *timeval, const char *timestr, int duration);
|
||||
|
||||
/**
|
||||
* Parse the input string p according to the format string fmt and
|
||||
* store its results in the structure dt.
|
||||
* This implementation supports only a subset of the formats supported
|
||||
* by the standard strptime().
|
||||
*
|
||||
* In particular it actually supports the parameters:
|
||||
* - %H: the hour as a decimal number, using a 24-hour clock, in the
|
||||
* range '00' through '23'
|
||||
* - %J: hours as a decimal number, in the range '0' through INT_MAX
|
||||
* - %M: the minute as a decimal number, using a 24-hour clock, in the
|
||||
* range '00' through '59'
|
||||
* - %S: the second as a decimal number, using a 24-hour clock, in the
|
||||
* range '00' through '59'
|
||||
* - %Y: the year as a decimal number, using the Gregorian calendar
|
||||
* - %m: the month as a decimal number, in the range '1' through '12'
|
||||
* - %d: the day of the month as a decimal number, in the range '1'
|
||||
* through '31'
|
||||
* - %%: a literal '%'
|
||||
*
|
||||
* @return a pointer to the first character not processed in this
|
||||
* function call, or NULL in case the function fails to match all of
|
||||
* the fmt string and therefore an error occurred
|
||||
*/
|
||||
char *av_small_strptime(const char *p, const char *fmt, struct tm *dt);
|
||||
|
||||
/**
|
||||
* Attempt to find a specific tag in a URL.
|
||||
*
|
||||
@ -179,6 +153,38 @@ char *av_small_strptime(const char *p, const char *fmt, struct tm *dt);
|
||||
*/
|
||||
int av_find_info_tag(char *arg, int arg_size, const char *tag1, const char *info);
|
||||
|
||||
/**
|
||||
* Simplified version of strptime
|
||||
*
|
||||
* Parse the input string p according to the format string fmt and
|
||||
* store its results in the structure dt.
|
||||
* This implementation supports only a subset of the formats supported
|
||||
* by the standard strptime().
|
||||
*
|
||||
* The supported input field descriptors are listed below.
|
||||
* - %H: the hour as a decimal number, using a 24-hour clock, in the
|
||||
* range '00' through '23'
|
||||
* - %J: hours as a decimal number, in the range '0' through INT_MAX
|
||||
* - %M: the minute as a decimal number, using a 24-hour clock, in the
|
||||
* range '00' through '59'
|
||||
* - %S: the second as a decimal number, using a 24-hour clock, in the
|
||||
* range '00' through '59'
|
||||
* - %Y: the year as a decimal number, using the Gregorian calendar
|
||||
* - %m: the month as a decimal number, in the range '1' through '12'
|
||||
* - %d: the day of the month as a decimal number, in the range '1'
|
||||
* through '31'
|
||||
* - %T: alias for '%H:%M:%S'
|
||||
* - %%: a literal '%'
|
||||
*
|
||||
* @return a pointer to the first character not processed in this function
|
||||
* call. In case the input string contains more characters than
|
||||
* required by the format string the return value points right after
|
||||
* the last consumed input character. In case the whole input string
|
||||
* is consumed the return value points to the null byte at the end of
|
||||
* the string. On failure NULL is returned.
|
||||
*/
|
||||
char *av_small_strptime(const char *p, const char *fmt, struct tm *dt);
|
||||
|
||||
/**
|
||||
* Convert the decomposed UTC time in tm to a time_t value.
|
||||
*/
|
||||
|
@ -57,7 +57,7 @@
|
||||
|
||||
#define LIBAVUTIL_VERSION_MAJOR 54
|
||||
#define LIBAVUTIL_VERSION_MINOR 22
|
||||
#define LIBAVUTIL_VERSION_MICRO 100
|
||||
#define LIBAVUTIL_VERSION_MICRO 101
|
||||
|
||||
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
|
||||
LIBAVUTIL_VERSION_MINOR, \
|
||||
|
Loading…
x
Reference in New Issue
Block a user