# HG changeset patch
# User Darren Salt <linux@...>
# Date 1187645144 -3600
# Node ID 6b39d9d7db5b7af5f22b487be569084f57cf7db0
# Parent 7f3115b8ef1e4126a6ff7a6714ce56e42ee0176c
Handle % escaping and variable numbers of /s in VCD MRLs.
diff -r 6b39d9d7db5b7af5f22b487be569084f57cf7db0 -r 7f3115b8ef1e4126a6ff7a6714ce56e42ee0176c ChangeLog
--- a/ChangeLog Mon Aug 20 22:25:44 2007 +0100
+++ b/ChangeLog Mon Aug 20 21:46:34 2007 +0100
@@ -11,7 +11,7 @@ xine-lib (1.1.8) (Unreleased)
* Various build fixes and cleanups for Solaris, plugin dependencies etc.
* Fix some memory leaks in the Vorbis decoder and video overlays.
* Fix a problem with the goom plugin which could cause it to stop working.
- * Clean up "%" unescaping in MRLs; correctly handle "%" in DVD MRLs.
+ * Clean up "%" unescaping in MRLs; correctly handle "%" in DVD and VCD MRLs.
* Fix a crash with "dvb:/".
* DVB subtitle fixes: deadlock prevention, thread leakage, spec compliance.
* Allow the DVB input plugin to timeout if it is receiving no signal.
diff -r 6b39d9d7db5b7af5f22b487be569084f57cf7db0 -r 7f3115b8ef1e4126a6ff7a6714ce56e42ee0176c src/input/vcd/xineplug_inp_vcd.c
--- a/src/input/vcd/xineplug_inp_vcd.c Mon Aug 20 22:25:44 2007 +0100
+++ b/src/input/vcd/xineplug_inp_vcd.c Mon Aug 20 21:46:34 2007 +0100
@@ -502,14 +502,16 @@ vcd_parse_mrl(/*in*/ const char *default
itemid->type = (vcdinfo_item_enum_t) auto_type;
*used_default = false;
- if ( NULL != mrl && !strncasecmp(mrl, MRL_PREFIX, MRL_PREFIX_LEN) )
- p = &mrl[MRL_PREFIX_LEN];
- else {
+ if ( NULL == mrl || strncasecmp(mrl, MRL_PREFIX, MRL_PREFIX_LEN) )
return false;
- }
-
- count = sscanf (p, "%1024[^@]@%1[EePpSsTt]%u",
- device_str, type_str, &num);
+ p = &mrl[MRL_PREFIX_LEN - 2];
+ while (*p == '/')
+ ++p;
+
+ device_str[0] = '/';
+ device_str[1] = 0;
+ count = sscanf (p, "%1023[^@]@%1[EePpSsTt]%u",
+ device_str + 1, type_str, &num);
itemid->num = num;
switch (count) {
@@ -522,11 +524,18 @@ vcd_parse_mrl(/*in*/ const char *default
itemid->num = num;
if (1==count) {
type_str[0] = 'T';
+ if (default_vcd_device)
+ strncpy(device_str, default_vcd_device, MAX_DEVICE_LEN);
+ else
+ *device_str = 0;
}
-
+ else
+ _x_mrl_unescape (device_str);
break;
}
-
+ case 2 ... 9:
+ _x_mrl_unescape (device_str);
+
case 0:
case EOF:
{
|