MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / resolve_content_path

Function resolve_content_path

libavformat/dashdec.c:709–847  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

707}
708
709static int resolve_content_path(AVFormatContext *s, const char *url, int *max_url_size, xmlNodePtr *baseurl_nodes, int n_baseurl_nodes)
710{
711 char *tmp_str = NULL;
712 char *path = NULL;
713 char *mpdName = NULL;
714 xmlNodePtr node = NULL;
715 char *baseurl = NULL;
716 char *root_url = NULL;
717 char *text = NULL;
718 char *tmp = NULL;
719 int isRootHttp = 0;
720 char token ='/';
721 int start = 0;
722 int rootId = 0;
723 int updated = 0;
724 int size = 0;
725 int i;
726 int tmp_max_url_size = strlen(url);
727
728 for (i = n_baseurl_nodes-1; i >= 0 ; i--) {
729 text = xmlNodeGetContent(baseurl_nodes[i]);
730 if (!text)
731 continue;
732 tmp_max_url_size += strlen(text);
733 if (ishttp(text)) {
734 xmlFree(text);
735 break;
736 }
737 xmlFree(text);
738 }
739
740 tmp_max_url_size = aligned(tmp_max_url_size);
741 text = av_mallocz(tmp_max_url_size + 1);
742 if (!text) {
743 updated = AVERROR(ENOMEM);
744 goto end;
745 }
746 av_strlcpy(text, url, strlen(url)+1);
747 tmp = text;
748 while (mpdName = av_strtok(tmp, "/", &tmp)) {
749 size = strlen(mpdName);
750 }
751 av_free(text);
752
753 path = av_mallocz(tmp_max_url_size + 2);
754 tmp_str = av_mallocz(tmp_max_url_size);
755 if (!tmp_str || !path) {
756 updated = AVERROR(ENOMEM);
757 goto end;
758 }
759
760 av_strlcpy (path, url, strlen(url) - size + 1);
761 for (rootId = n_baseurl_nodes - 1; rootId > 0; rootId --) {
762 if (!(node = baseurl_nodes[rootId])) {
763 continue;
764 }
765 text = xmlNodeGetContent(node);
766 if (ishttp(text)) {

Callers 1

Calls 11

ishttpFunction · 0.85
alignedFunction · 0.85
av_strlcpyFunction · 0.85
av_strtokFunction · 0.85
av_strcasecmpFunction · 0.85
av_strlcatFunction · 0.85
av_strstartFunction · 0.85
av_stristrFunction · 0.85
av_strncasecmpFunction · 0.85
av_malloczFunction · 0.50
av_freeFunction · 0.50

Tested by

no test coverage detected