diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | src/xine-engine/xine.c | 17 |
2 files changed, 18 insertions, 1 deletions
@@ -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 ) ) { |