[FFmpeg-cvslog] r25316 - trunk/libavformat/applehttp.c
mstorsjo
subversion
Sat Oct 2 23:57:59 CEST 2010
Author: mstorsjo
Date: Sat Oct 2 23:57:58 2010
New Revision: 25316
Log:
applehttp: Allow the base url to be a local file name, too
Modified:
trunk/libavformat/applehttp.c
Modified: trunk/libavformat/applehttp.c
==============================================================================
--- trunk/libavformat/applehttp.c Sat Oct 2 22:37:43 2010 (r25315)
+++ trunk/libavformat/applehttp.c Sat Oct 2 23:57:58 2010 (r25316)
@@ -90,7 +90,7 @@ static void make_absolute_url(char *buf,
const char *rel)
{
char *sep;
- if (!base || strstr(rel, "://")) {
+ if (!base || strstr(rel, "://") || rel[0] == '/') {
av_strlcpy(buf, rel, size);
return;
}
@@ -99,13 +99,15 @@ static void make_absolute_url(char *buf,
sep = strrchr(buf, '/');
if (sep)
sep[1] = '\0';
- while (av_strstart(rel, "../", NULL)) {
- if (sep) {
+ else
+ buf[0] = '\0';
+ while (av_strstart(rel, "../", NULL) && sep) {
sep[0] = '\0';
sep = strrchr(buf, '/');
if (sep)
sep[1] = '\0';
- }
+ else
+ buf[0] = '\0';
rel += 3;
}
av_strlcat(buf, rel, size);
More information about the ffmpeg-cvslog
mailing list