diff options
author | phintuka <phintuka> | 2008-01-03 19:05:07 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2008-01-03 19:05:07 +0000 |
commit | 11d222ce6d4be6ee629ac348164cf232d2b28d3d (patch) | |
tree | 5583f3050e9202494e8bdea736e0dc7ed9f46c43 /xine_input_vdr.c | |
parent | 69b5d11760aa1d5787dd72bffad8f0c962d259c3 (diff) | |
download | xineliboutput-11d222ce6d4be6ee629ac348164cf232d2b28d3d.tar.gz xineliboutput-11d222ce6d4be6ee629ac348164cf232d2b28d3d.tar.bz2 |
Use "file:" mrl when replaying media files or images
Diffstat (limited to 'xine_input_vdr.c')
-rw-r--r-- | xine_input_vdr.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/xine_input_vdr.c b/xine_input_vdr.c index 3e7a0e02..6e57d7ad 100644 --- a/xine_input_vdr.c +++ b/xine_input_vdr.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_input_vdr.c,v 1.105 2008-01-03 15:33:40 phintuka Exp $ + * $Id: xine_input_vdr.c,v 1.106 2008-01-03 19:05:07 phintuka Exp $ * */ @@ -2772,6 +2772,7 @@ static int handle_control_playfile(vdr_input_plugin_t *this, const char *cmd) strn0cpy(filename, pt, sizeof(filename)); if(*filename) { + int is_file_mrl = !strncmp(filename, "file:/", 6) ? 5 : 0; this->loop_play = 0; if(this->slave_stream) @@ -2781,11 +2782,11 @@ static int handle_control_playfile(vdr_input_plugin_t *this, const char *cmd) loop, pos, av, filename); /* check if it is really a file (not mrl) and try to access it */ - if(filename[0] == '/') { + if(is_file_mrl || filename[0] == '/') { struct stat st; char *f = unescape_filename(filename); errno = 0; - if(stat(f, &st)) { + if(stat(f+is_file_mrl, &st)) { if(errno == EACCES || errno == ELOOP) LOGERR("Can't access file !"); if(errno == ENOENT || errno == ENOTDIR) @@ -2800,7 +2801,7 @@ static int handle_control_playfile(vdr_input_plugin_t *this, const char *cmd) if(sub) *sub = 0; snprintf(mrlbase, sizeof(mrlbase), "http://%s:%d/PLAYFILE", host?:"127.0.0.1", iport); - sprintf(mrl, "%s%s", mrlbase, filename); + sprintf(mrl, "%s%s", mrlbase, filename + is_file_mrl); if(sub) { sub += 10; /*strlen("#subtitle:");*/ strcat(mrl, "#subtitle:"); |