From 8b37a1bc306c1d5a3cc92e9dc04fb95d5d9a0298 Mon Sep 17 00:00:00 2001 From: trav90 Date: Thu, 26 Apr 2018 16:49:15 -0500 Subject: [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. --- media/ffvpx/libavutil/avstring.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'media/ffvpx/libavutil/avstring.c') diff --git a/media/ffvpx/libavutil/avstring.c b/media/ffvpx/libavutil/avstring.c index 1787a1ef5..f03dd2514 100644 --- a/media/ffvpx/libavutil/avstring.c +++ b/media/ffvpx/libavutil/avstring.c @@ -231,6 +231,29 @@ int av_strncasecmp(const char *a, const char *b, size_t n) return c1 - c2; } +char *av_strireplace(const char *str, const char *from, const char *to) +{ + char *ret = NULL; + const char *pstr2, *pstr = str; + size_t tolen = strlen(to), fromlen = strlen(from); + AVBPrint pbuf; + + av_bprint_init(&pbuf, 1, AV_BPRINT_SIZE_UNLIMITED); + while ((pstr2 = av_stristr(pstr, from))) { + av_bprint_append_data(&pbuf, pstr, pstr2 - pstr); + pstr = pstr2 + fromlen; + av_bprint_append_data(&pbuf, to, tolen); + } + av_bprint_append_data(&pbuf, pstr, strlen(pstr)); + if (!av_bprint_is_complete(&pbuf)) { + av_bprint_finalize(&pbuf, NULL); + } else { + av_bprint_finalize(&pbuf, &ret); + } + + return ret; +} + const char *av_basename(const char *path) { char *p = strrchr(path, '/'); -- cgit v1.2.3