summaryrefslogtreecommitdiff
path: root/src/xine-engine/demux.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xine-engine/demux.c')
-rw-r--r--src/xine-engine/demux.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c
index f33397256..187c27873 100644
--- a/src/xine-engine/demux.c
+++ b/src/xine-engine/demux.c
@@ -448,6 +448,11 @@ int _x_demux_read_header( input_plugin_t *input, unsigned char *buffer, off_t si
int _x_demux_check_extension (const char *mrl, const char *extensions){
char *last_dot, *e, *ext_copy, *ext_work;
+ int found = 0;
+
+ /* An empty extensions string means that the by-extension method can't
+ be used, so consider those cases as always passing. */
+ if ( extensions == NULL ) return 1;
ext_copy = strdup(extensions);
ext_work = ext_copy;
@@ -455,15 +460,23 @@ int _x_demux_check_extension (const char *mrl, const char *extensions){
last_dot = strrchr (mrl, '.');
if (last_dot) {
last_dot++;
- while ( ( e = xine_strsep(&ext_work, " ")) != NULL ) {
+ }
+
+ while ( ( e = xine_strsep(&ext_work, " ")) != NULL ) {
+ if ( strstr(e, ":/") ) {
+ if ( strcasecmp (mrl, e) == 0 ) {
+ found = 1;
+ break;
+ }
+ } else if (last_dot) {
if (strcasecmp (last_dot, e) == 0) {
- free(ext_copy);
- return 1;
+ found = 1;
+ break;
}
}
}
free(ext_copy);
- return 0;
+ return found;
}