diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-09-07 18:46:32 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-09-21 04:50:58 +0200 |
commit | 1aee02c7c13ffd30135cac7d3d0c2fafdc922dc4 (patch) | |
tree | 004a9830f38802c40a1dfcdcdcd7179736356008 /libavformat | |
parent | 0f9ade1ff395cfaf51f9a7ecc1ed725339aa1426 (diff) | |
download | ffmpeg-1aee02c7c13ffd30135cac7d3d0c2fafdc922dc4.tar.gz |
avformat/dashdec: Avoid duplicating string
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/dashdec.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c index 548a71d6dc..99b9c45439 100644 --- a/libavformat/dashdec.c +++ b/libavformat/dashdec.c @@ -1183,7 +1183,6 @@ static int parse_manifest(AVFormatContext *s, const char *url, AVIOContext *in) DASHContext *c = s->priv_data; int ret = 0; int close_in = 0; - uint8_t *new_url = NULL; int64_t filesize = 0; AVBPrint buf; AVDictionary *opts = NULL; @@ -1212,11 +1211,8 @@ static int parse_manifest(AVFormatContext *s, const char *url, AVIOContext *in) return ret; } - if (av_opt_get(in, "location", AV_OPT_SEARCH_CHILDREN, &new_url) >= 0) { - c->base_url = av_strdup(new_url); - } else { + if (av_opt_get(in, "location", AV_OPT_SEARCH_CHILDREN, (uint8_t**)&c->base_url) < 0) c->base_url = av_strdup(url); - } filesize = avio_size(in); filesize = filesize > 0 ? filesize : DEFAULT_MANIFEST_SIZE; @@ -1359,7 +1355,6 @@ cleanup: xmlFreeNode(mpd_baseurl_node); } - av_free(new_url); av_bprint_finalize(&buf, NULL); if (close_in) { avio_close(in); |