summaryrefslogtreecommitdiffstats
path: root/media/ffvpx/libavutil/parseutils.c
diff options
context:
space:
mode:
authortrav90 <travawine@protonmail.ch>2018-04-26 16:49:15 -0500
committertrav90 <travawine@protonmail.ch>2018-04-26 16:49:15 -0500
commit8b37a1bc306c1d5a3cc92e9dc04fb95d5d9a0298 (patch)
treec37da5241afd7cda6f92d394e14cef7d5dcbb4e5 /media/ffvpx/libavutil/parseutils.c
parent56a2df6b25bc93ea9a59b8e0bf8029f752f68573 (diff)
downloadUXP-8b37a1bc306c1d5a3cc92e9dc04fb95d5d9a0298.tar
UXP-8b37a1bc306c1d5a3cc92e9dc04fb95d5d9a0298.tar.gz
UXP-8b37a1bc306c1d5a3cc92e9dc04fb95d5d9a0298.tar.lz
UXP-8b37a1bc306c1d5a3cc92e9dc04fb95d5d9a0298.tar.xz
UXP-8b37a1bc306c1d5a3cc92e9dc04fb95d5d9a0298.zip
[ffvpx] Update ffvp9/ffvp8 to 3.4.2-release
Structure of code was slightly modified so that it should be no longer necessary to re-generate the config_*.h files, greatly simplifying the resync process in the future.
Diffstat (limited to 'media/ffvpx/libavutil/parseutils.c')
-rw-r--r--media/ffvpx/libavutil/parseutils.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/media/ffvpx/libavutil/parseutils.c b/media/ffvpx/libavutil/parseutils.c
index a2464cfc6..be4ea1ee1 100644
--- a/media/ffvpx/libavutil/parseutils.c
+++ b/media/ffvpx/libavutil/parseutils.c
@@ -140,6 +140,11 @@ static const VideoRateAbbr video_rate_abbrs[]= {
{ "ntsc-film", { 24000, 1001 } },
};
+static const char *months[12] = {
+ "january", "february", "march", "april", "may", "june", "july", "august",
+ "september", "october", "november", "december"
+};
+
int av_parse_video_size(int *width_ptr, int *height_ptr, const char *str)
{
int i;
@@ -466,6 +471,21 @@ static int date_get_num(const char **pp,
return val;
}
+static int date_get_month(const char **pp) {
+ int i = 0;
+ for (; i < 12; i++) {
+ if (!av_strncasecmp(*pp, months[i], 3)) {
+ const char *mo_full = months[i] + 3;
+ int len = strlen(mo_full);
+ *pp += 3;
+ if (len > 0 && !av_strncasecmp(*pp, mo_full, len))
+ *pp += len;
+ return i;
+ }
+ }
+ return -1;
+}
+
char *av_small_strptime(const char *p, const char *fmt, struct tm *dt)
{
int c, val;
@@ -525,6 +545,14 @@ char *av_small_strptime(const char *p, const char *fmt, struct tm *dt)
if (!p)
return NULL;
break;
+ case 'b':
+ case 'B':
+ case 'h':
+ val = date_get_month(&p);
+ if (val == -1)
+ return NULL;
+ dt->tm_mon = val;
+ break;
case '%':
if (*p++ != '%')
return NULL;