Commit 9c37c812 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '27f27462'

* commit '27f27462':
  parseutils: Make av_small_strptime public

Conflicts:
	doc/APIchanges
	libavformat/utils.c
	libavutil/parseutils.c
	libavutil/version.h

See: 29e972f6Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 0739179b 27f27462
...@@ -4079,8 +4079,8 @@ int64_t ff_iso8601_to_unix_time(const char *datestr) ...@@ -4079,8 +4079,8 @@ int64_t ff_iso8601_to_unix_time(const char *datestr)
{ {
struct tm time1 = { 0 }, time2 = { 0 }; struct tm time1 = { 0 }, time2 = { 0 };
char *ret1, *ret2; char *ret1, *ret2;
ret1 = av_small_strptime(datestr, "%Y - %m - %d %H:%M:%S", &time1); ret1 = av_small_strptime(datestr, "%Y - %m - %d %T", &time1);
ret2 = av_small_strptime(datestr, "%Y - %m - %dT%H:%M:%S", &time2); ret2 = av_small_strptime(datestr, "%Y - %m - %dT%T", &time2);
if (ret2 && !ret1) if (ret2 && !ret1)
return av_timegm(&time2); return av_timegm(&time2);
else else
......
...@@ -146,39 +146,45 @@ const char *av_get_known_color_name(int color_idx, const uint8_t **rgb); ...@@ -146,39 +146,45 @@ 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); int av_parse_time(int64_t *timeval, const char *timestr, int duration);
/** /**
* Attempt to find a specific tag in a URL.
*
* syntax: '?tag1=val1&tag2=val2...'. Little URL decoding is done.
* Return 1 if found.
*/
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 * Parse the input string p according to the format string fmt and
* store its results in the structure dt. * store its results in the structure dt.
* This implementation supports only a subset of the formats supported * This implementation supports only a subset of the formats supported
* by the standard strptime(). * by the standard strptime().
* *
* In particular it actually supports the parameters: * The supported input field descriptors are listed below.
* - %H: the hour as a decimal number, using a 24-hour clock, in the * - %H: the hour as a decimal number, using a 24-hour clock, in the
* range '00' through '23' * range '00' through '23'
* - %J: hours as a decimal number, in the range '0' through INT_MAX * - %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 * - %M: the minute as a decimal number, using a 24-hour clock, in the
* range '00' through '59' * range '00' through '59'
* - %S: the second as a decimal number, using a 24-hour clock, in the * - %S: the second as a decimal number, using a 24-hour clock, in the
* range '00' through '59' * range '00' through '59'
* - %Y: the year as a decimal number, using the Gregorian calendar * - %Y: the year as a decimal number, using the Gregorian calendar
* - %m: the month as a decimal number, in the range '1' through '12' * - %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' * - %d: the day of the month as a decimal number, in the range '1'
* through '31' * through '31'
* - %T: alias for '%H:%M:%S'
* - %%: a literal '%' * - %%: a literal '%'
* *
* @return a pointer to the first character not processed in this * @return a pointer to the first character not processed in this function
* function call, or NULL in case the function fails to match all of * call. In case the input string contains more characters than
* the fmt string and therefore an error occurred * 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); char *av_small_strptime(const char *p, const char *fmt, struct tm *dt);
/**
* Attempt to find a specific tag in a URL.
*
* syntax: '?tag1=val1&tag2=val2...'. Little URL decoding is done.
* Return 1 if found.
*/
int av_find_info_tag(char *arg, int arg_size, const char *tag1, const char *info);
/** /**
* Convert the decomposed UTC time in tm to a time_t value. * Convert the decomposed UTC time in tm to a time_t value.
*/ */
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
#define LIBAVUTIL_VERSION_MAJOR 54 #define LIBAVUTIL_VERSION_MAJOR 54
#define LIBAVUTIL_VERSION_MINOR 22 #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, \ #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \ LIBAVUTIL_VERSION_MINOR, \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment