diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2007-08-20 22:25:44 +0100 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2007-08-20 22:25:44 +0100 |
commit | b7fd78c6a875b25cf273f0a25ad410f5d997a3bf (patch) | |
tree | c6435f89411d630e3593f42dcbab81ecb8406149 | |
parent | 693223d03aa138903a6aadc8fe546972b0fa5227 (diff) | |
download | xine-lib-b7fd78c6a875b25cf273f0a25ad410f5d997a3bf.tar.gz xine-lib-b7fd78c6a875b25cf273f0a25ad410f5d997a3bf.tar.bz2 |
Handle % escaping and variable numbers of /s in VCD MRLs.
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | src/input/vcd/xineplug_inp_vcd.c | 27 |
2 files changed, 19 insertions, 10 deletions
@@ -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 --git a/src/input/vcd/xineplug_inp_vcd.c b/src/input/vcd/xineplug_inp_vcd.c index 9eb9ac996..795a2480d 100644 --- a/src/input/vcd/xineplug_inp_vcd.c +++ b/src/input/vcd/xineplug_inp_vcd.c @@ -502,14 +502,16 @@ vcd_parse_mrl(/*in*/ const char *default_vcd_device, /*in*/ char *mrl, 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_vcd_device, /*in*/ char *mrl, 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: { |