mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
dash: save 1 or 2 string copies when getting fragment uris
Only create new string if required, saving maybe 1 or 2 str copies per fragment.
This commit is contained in:
parent
764087b4b8
commit
4c89fab390
1 changed files with 10 additions and 4 deletions
|
@ -3356,19 +3356,25 @@ gst_mpd_client_get_next_fragment (GstMpdClient * client,
|
|||
} else if (strncmp (mediaURL, "http://", 7) != 0) {
|
||||
fragment->uri =
|
||||
g_strconcat (stream->baseURL, mediaURL, stream->queryURL, NULL);
|
||||
} else {
|
||||
g_free (mediaURL);
|
||||
} else if (stream->queryURL) {
|
||||
fragment->uri = g_strconcat (mediaURL, stream->queryURL, NULL);
|
||||
g_free (mediaURL);
|
||||
} else {
|
||||
fragment->uri = mediaURL;
|
||||
}
|
||||
g_free (mediaURL);
|
||||
|
||||
if (indexURL != NULL) {
|
||||
if (strncmp (indexURL, "http://", 7) != 0) {
|
||||
fragment->index_uri =
|
||||
g_strconcat (stream->baseURL, indexURL, stream->queryURL, NULL);
|
||||
} else {
|
||||
g_free (indexURL);
|
||||
} else if (stream->queryURL) {
|
||||
fragment->index_uri = g_strconcat (indexURL, stream->queryURL, NULL);
|
||||
g_free (indexURL);
|
||||
} else {
|
||||
fragment->index_uri = indexURL;
|
||||
}
|
||||
g_free (indexURL);
|
||||
} else if (fragment->index_range_start || fragment->index_range_end != -1) {
|
||||
/* index has no specific URL but has a range, we should only use this if
|
||||
* the media also has a range, otherwise we are serving some data twice
|
||||
|
|
Loading…
Reference in a new issue