summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2008-01-20 15:14:25 +0000
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2008-01-20 15:14:25 +0000
commitdd125c93bdfbef26909ad684b678781abfd88c4a (patch)
tree5bc5f3decffb32353fb36c5328f007d24eec8183
parent21cdfa5236fa3a76c87ef9ea9a783fcce394eafe (diff)
downloadxine-lib-dd125c93bdfbef26909ad684b678781abfd88c4a.tar.gz
xine-lib-dd125c93bdfbef26909ad684b678781abfd88c4a.tar.bz2
Don't unescape #subtitle:scheme://data.
This was broken in 1.1.8 when #subtitle:/file was fixed.
-rw-r--r--ChangeLog2
-rw-r--r--src/xine-engine/xine.c17
2 files changed, 18 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 9da723f22..97c69817b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
xine-lib (1.1.10) (unreleased)
* Update Ogg and Annodex mimetypes and extensions.
* Change the default v4l device paths to /dev/video0 and /dev/radio0.
+ * Fix support for subtitles with schemes (e.g. http://), partly broken
+ since 1.1.8.
xine-lib (1.1.9.1)
* Security fixes:
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index eae13bec9..4f6ba2a80 100644
--- a/src/xine-engine/xine.c
+++ b/src/xine-engine/xine.c
@@ -780,6 +780,19 @@ void _x_flush_events_queues (xine_stream_t *stream) {
pthread_mutex_unlock (&stream->event_queues_lock);
}
+static inline int _x_path_looks_like_mrl (const char *path)
+{
+ if ((*path & 0xDF) < 'A' || (*path & 0xDF) > 'Z')
+ return 0;
+
+ for (++path; *path; ++path)
+ if ((*path != '-' && *path < '0') || (*path > '9' && *path < 'A') ||
+ (*path > 'Z' && *path < 'a') || *path > 'z')
+ break;
+
+ return path[0] == ':' && path[1] == '/';
+}
+
/*static*/ int open_internal (xine_stream_t *stream, const char *mrl) {
const char *stream_setup = NULL;
@@ -1091,7 +1104,9 @@ void _x_flush_events_queues (xine_stream_t *stream) {
memcpy(subtitle_mrl, tmp, strlen(tmp));
subtitle_mrl[strlen(tmp)] = '\0';
}
- _x_mrl_unescape(subtitle_mrl);
+ /* unescape for xine_open() if the MRL looks like a raw pathname */
+ if (!_x_path_looks_like_mrl(subtitle_mrl))
+ _x_mrl_unescape(subtitle_mrl);
stream->slave = xine_stream_new (stream->xine, NULL, stream->video_out );
stream->slave_affection = XINE_MASTER_SLAVE_PLAY | XINE_MASTER_SLAVE_STOP;
if( xine_open( stream->slave, subtitle_mrl ) ) {